Private Sub Command1_ Click()
Dim i As Integer, j As Integer, n As Integer, flag As Boolean
Dim st As String, szm As String, ch As String, word As String, tmp As String
st = Text1. Text
szm = Text2. Text
flag = True: n=0
For i=1 To Len(st)
If ch = szm And flag = True Then
n=n+1: word = ch
For j=i+1 To Len(st)
tmp = Mid(st, j, 1)
If tmp<>””And tmp <>”.”And tmp <>“,” Then
Else
List1. AddItem Str(n) +“.”+ word
i=j
Exit For
End If
Next j
ElseIf ch=“” Or ch=“,” Or ch= “.”Then
Else
flag = False
End If
Next i
Label1.Caption=“字母”+ szm +“开头的单词总数:”+ str(n)
End Sub