Dim jsdata As Variant
Dim qdata(64) As Single
Dim jdata(64) As Single
Dim zhdata(64) As Single
Dim a, b As Single
For i = 0 To 64
If i = 64 Then Exit For
jsdata = MSComm1.Input
qdata(i) = jsdata(0)
Text1(i).Text = Hex(qdata(i))
Text2(i).Text = qdata(i)
Next i
For i = 0 To 64
If i = 63 Then Exit For
zhdata(i) = CSng(qdata(i) - 48)
Text4(i).Text = zhdata(i)
Next i
For i = 2 To 62 Step 2
If i = 62 Then Exit For
jdata(i) = zhdata(i) * 10 + zhdata(i - 1)
Text3(i / 2).Text = jdata(i)
Next i
End Sub
我在每个for下面都加了一句if语句来跳出循环,没有这个语句的话就跳不出来,直到提示下标越界,哪位知道为什么啊?然后我加断点F8运行的时候正常,自动运行的时候提示下标越界,说明自动运行时没有执行IF语句!!郁闷ing~~!!大家给看看!!这个是串口返回数据的计算问题!!再有就是有没有哪个高手愿意加我QQ:30297208,带带我,我是个新手!!