慕丝7291255
Option Base 1Dim s As String'读取数据in4.dat中的数据并用s代替Private Sub Command1_Click()Open App.Path & "\in4.dat" For Input As #1s = Input(LOF(1), #1)Close #1Text1.Text = sEnd SubPrivate Sub Command2_Click()Dim m As IntegerIf Len(s) = 0 ThenMsgBox "请先使用“读数据”功能!"ElseIf Text1.SelLength = 0 ThenMsgBox "请先选中文本!"Elset = ""For i = 1 To Text1.SelLengthc = Mid(Text1.SelText, i, 1)If c <> " " Thent = t + cElseIf LCase(t) = "the" Thenm = m + 1End Ift = ""End IfNext iText2.Text = Str(m)End IfEnd IfEnd Sub