VB编程题,高手请进~~

读数据(英文),在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"的啊!!

第1个回答  2009-08-19
S是什么?内容太多
Text1.? = 0 这个又是什么?判断是不是0?
c <> " " 条件也有错误啊,如果没有空格,一辈子也算不出M是多少
? = "the" right(t,3)???如果t小于三个报错
mid(t, Len(t)-3, 3)报错是不会报错了
? = Str(m) text2.text这个没错
第2个回答  2009-08-19
第一个?=0
?=SelLength
?=t
?=Text2.Text
没有调试,可能就这样了本回答被提问者采纳
相似回答
大家正在搜