Private Sub cmdCha_Click()
If txtShu.Text = "" Then
MessageBox.Show ("不为空,请输入关键词")
Else
For i = 0 To UBound(Myword)
If LCase(txtShu.Text) = LCase(Myword(i)) Then
txtFan.Text = Myexplan(i)
Exit Sub
End If
Next i
MessageBox.Show ("你查询的关键词不存在")
End If
End Sub
Private Sub Form_Load()
Dim main As String
Dim Myword() As String
Dim Myexplan() As String
Dim words As Integer
word = 0 '记录连接数据的文本TXT 单词个数
Dim chang As Integer ' 单词长度
Dim i As Integer
Dim n As String '读取相应的单词
Dim m As String '读取单词的中文解释
Dim stringchang As Integer '计算单词后字符串的长度
txtShu.Text = ""
txtFan.Text = ""
Open App.Path & "\data\eng.xcd" For Input As #2
i = 1
Do Until EOF(2)
Line Input #2, main
chang = InStr(main, " ") '查找空格的位子
ReDim Preserve Myword(i)
ReDim Preserve Myexplan(i)
Myword(i) = Val(Left(main, chang - 1)) '截取空格字符:单词
Myexplan(i) = Mid(main, chang + 1) '剩下的字符串赋给变量值m
i = i + 1
Loop
Close #2
End Sub
If txtShu.Text = "" Then
MessageBox.Show ("不为空,请输入关键词")
Else
For i = 0 To UBound(Myword)
If LCase(txtShu.Text) = LCase(Myword(i)) Then
txtFan.Text = Myexplan(i)
Exit Sub
End If
Next i
MessageBox.Show ("你查询的关键词不存在")
End If
End Sub
Private Sub Form_Load()
Dim main As String
Dim Myword() As String
Dim Myexplan() As String
Dim words As Integer
word = 0 '记录连接数据的文本TXT 单词个数
Dim chang As Integer ' 单词长度
Dim i As Integer
Dim n As String '读取相应的单词
Dim m As String '读取单词的中文解释
Dim stringchang As Integer '计算单词后字符串的长度
txtShu.Text = ""
txtFan.Text = ""
Open App.Path & "\data\eng.xcd" For Input As #2
i = 1
Do Until EOF(2)
Line Input #2, main
chang = InStr(main, " ") '查找空格的位子
ReDim Preserve Myword(i)
ReDim Preserve Myexplan(i)
Myword(i) = Val(Left(main, chang - 1)) '截取空格字符:单词
Myexplan(i) = Mid(main, chang + 1) '剩下的字符串赋给变量值m
i = i + 1
Loop
Close #2
End Sub


