读数据(英文),在text2中显示"the"出现的次数.程序不完整,请把?的地方改为正确内容
Private Sub Command2_Click()
Dim m As Integer
If Len(s) = ? Then
MsgBox "请先使用“读数据”功能!"
Else
If Text1.? = 0 Then
MsgBox "请先选中文本!"
Else
t = ""
For i = 1 To Text1.SelLength
c = Mid(Text1.SelText, i, 1)
If c <> " " Then
t = t + c
Else
If ? = "the" Then
m = m + 1
End If
t = ""
End If
Next i
? = Str(m)
End If
End If
End Sub
题目原先提供的
Open App.Path & "\in4.dat" For Input As #1
s = Input(LOF(1), #1)
Close #1
Text1.Text = s
End Sub 这是一道2级计算机VB试题,题目本身应该不会有错的~
我写的是~~
If Len(s) = 0 Then
If Text1.selLength = 0 Then
If ? = "the" Then(这个不会写)
Text2.Text = Str(m)
不知道对不对?运行了下,老显示0,文本中有"the"的啊!!