主题:发现一个神奇的事情
Private Sub Command1_Click()
Dim s() As Byte
ReDim s(1)
s(0) = 221
s(1) = 0
Dim cs As String
cs = s
Debug.Print Asc(cs), Asc("Y"), cs
MsgBox cs
If cs = "Y" Then MsgBox "ok"
Dim t() As Byte
t = cs
Debug.Print t(0); t(1)
Debug.Print
End Sub
Dim s() As Byte
ReDim s(1)
s(0) = 221
s(1) = 0
Dim cs As String
cs = s
Debug.Print Asc(cs), Asc("Y"), cs
MsgBox cs
If cs = "Y" Then MsgBox "ok"
Dim t() As Byte
t = cs
Debug.Print t(0); t(1)
Debug.Print
End Sub
把这段代码运行一下,你会发现很神奇!!