Private Sub Command1_Click( )
Dim s As String, t As String, n As Integer
Dim i As Integer, m As Integer
s = Text1.Text
n = Len(s)
For i = 1 To n
t = Mid(s,i,1)
If t >= "A" And t <= "Z" Then
m = ①
ElseIf t >= "a" And t <= "z" Then
m= m + Asc(t)- 96 ‘Asc(t)用于返回字符t的ASCII 码值
End If
Next i
For i = 2 To m - 1
If Then Exit For
Next i
If ② Then
Label1.Caption = "It is a prime word."
Else
Label1.Caption = "It is not a prime word."
End If
End Sub
① ②