图1
图2
Private Sub Command1_Click()
Dim a(1 To 100) As String ,s As String, ch As String, word As String
Dim i As Integer, j As Integer, k As Integer, numb As Integer
s = Text1.Text : k = 0 : word = ""
For i = 1 To Len(s)
ch = Mid(s, i, 1)
If ch >= "a" And ch <= "z" Or ch >= "A" And ch <= "Z" Then
If ch >= "A" And ch <= "Z" Then
word = word + ch
Else
flag = False
For j = 1 To k
If a(j) = word Then flag = True
Next j
If Not flag And word <> "" Then
a(k) = word
numb = numb + 1
End If
End If
Next i
Text2.Text = str(numb)
End Sub