Private Sub Command1_Click()
For i = 65 To 90
Print "ASCII:" & i & ",字符:" & Chr(i)
Print "ASCII:" & i + 32 & ",字符:" & Chr(i + 32)
Next i
End Sub
按照你的补充,应该用下面代码:
Private Sub Form_KeyPress(KeyAscii As Integer)
Print "ASCII:" & KeyAscii & ",字符:" & Chr(KeyAscii)
End Sub
Private Sub Command1_Click()
Print "ASCII:" & asc("A") & ",字符:" & Chr(65)
Print "ASCII:" & asc("a") & ",字符:" & Chr(97)
Print "ASCII:" & asc("B") & ",字符:" & Chr(66)
Print "ASCII:" & asc("b") & ",字符:" & Chr(98)
End Sub
Private Sub Command1_Click()
Dim i As Integer
i = 65
Do While (i <= 66)
Print "ASCII:" & i & ",字符:" & Chr(i)
Print "ASCII:" & i + 32 & ",字符:" & Chr(i + 32)
i = i + 1
Loop
End Sub