"查找ASCII最大的字符"/ C .Form1.AddItem "查找ASCII最大的字符")
Const n = 40
Private Sub Command1_Click()
Dim s As String, ch As String
Dim i As Integer, max As Integer
s = Text1.Text
max = 0
For i = 1 To Len(s)
ch =
If Asc(ch) > max Then max = Asc(ch)
Next i
Label1.Caption = "最大ASCII码:" + + " 该字符为:" + Chr(max)
End Sub
Private Sub Form_Load() ’随机生成可见字符并显示在文本框Text1中
Randomize
For i = 1 To n
Text1.Text = Text1.Text +
Next i
End Sub