vb的数据类型问题
为什么提示我ByRef参数类型不符。DataFromCom和Data都是什么数据类型?下面是部分代码:
Dim DataFromCom As Single '从串口读过来的实时值
Dim DataFromComLast As Single '上次的串口值
Dim Data As Single
Dim px(5000) As Single, py(5000) As Single
Dim ab(5) As Byte
Dim Buffer As Variant
Buffer = MSComm1.Input
ab(2) = Buffer(0) - 48
Buffer = MSComm1.Input
ab(3) = Buffer(0) - 48
Buffer = MSComm1.Input
ab(4) = Buffer(0) - 48
Buffer = MSComm1.Input
ab(5) = Buffer(0) - 48
b1 = CInt(ab(2))
b2 = CInt(ab(3))
b3 = CInt(ab(4))
b4 = CInt(ab(5))
Data = 20 * (b1 + b2 / 10 + b3 / 100 + b4 / 1000)
DataFromCom = Data
[ 本帖最后由 lvguidong123 于 2012-10-24 13:02 编辑 ]