以下是引用片段: Option Explicit Private Sub Command1_Click() Dim strInput$, Code$, Record$, c As String * 1 Dim i%, length%, iAsc% strInput = Text1.Text length = Len(Trim(strInput)) Code = "" For i = 1 To length c = mid(strInput, i, 1) Select Case c Case "A" To "Z" iAsc = Asc(c) + 5 If iAsc > Asc("Z") Then iAsc = iAsc - 26 Code = Code & Chr(iAsc) Case "a" To "z" iAsc = Asc(c) + 5 If iAsc > Asc("z") Then iAsc = iAsc - 26 Code = Code & Chr(iAsc) Case Else Code = Code & c End Select Next i Text2.Text = Code End Sub Private Sub Command3_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" Text1.SetFocus End Sub
以下是引用片段: Option Explicit Private Sub Command1_Click() Dim i As Integer, j As Integer Dim zimu(25) As Integer Dim allStr As String Dim aStr As String allStr = UCase(Text1.Text) For i = 1 To Len(Text1.Text) aStr = Mid(allStr, i, 1) If aStr >= "A" And aStr <= "Z" Then zimu(Asc(aStr) - Asc("A")) = zimu(Asc(aStr) - Asc("A")) + 1 End If Next i For i = 0 To 25 If zimu(i) <> 0 Then j = j + 1 Text2.Text = Text2.Text & Chr(i + Asc("A")) & ":" & str(zimu(i)) & " " If j Mod 5 = 0 Then Text2.Text = Text2.Text & Chr(13) & Chr(10) End If Next i End Sub
以下是引用片段: Option Base 1 Private Sub Command1_Click() Dim alpha(26) As Integer,n As Integer Dim i As Integer,s As String Open "c:\kav2003\readme.txt" For Input As #11 Do While Not EOF(11) s= (1) s=UCase(s) If s>="A" And s<="Z" Then n= (2) alpha(n)=alpha(n)+1 End If Loop For i=1 To 26 If alpha(i)<>0 Then List1.AddItem Chr(i+64)&":"&CStr(alpha(i)) End If Next i Close End Sub
以下是引用片段: Option Explicit Private Sub Form_Click() Dim Char() As String, St As String, Tem As String Dim Idx As Integer, Js As Long, Flen As Long Dim F As Boolean, W As String * 1 (1) Flen = LOF(10) St = Input(Flen, #10) Js = 1 Do While Js <= Flen+1 W = Mid(St, Js, 1) If (2) Then Tem = Tem + W F = True ElseIf F = True Then Idx = Idx + 1 ReDim Preserve Char(Idx) Char(Idx) = Tem Tem = (3) F = False End If (4) Loop Print "共有"; Idx; "个单词" For Js = 1 To Idx Print Char(Js) Next Js End Sub