现在我通过串口读外设的信息,外设发的数据是二进制格式,我用MSCOMM控件读
但我想把它读到数组里为什么不行呢dim buf(128) as byte
buf = MSComm1.Input
(提示不能给数组赋值)或者
dim buf as string
buf =mscomm1.input
text1.text=buf
(这个错极了)
但我想把它读到数组里为什么不行呢dim buf(128) as byte
buf = MSComm1.Input
(提示不能给数组赋值)或者
dim buf as string
buf =mscomm1.input
text1.text=buf
(这个错极了)
MSComm1.InputMode =comInputModeText然后
dim buf as string
buf =mscomm1.input
text1.text=buf
呵呵~
开始别定义固定长的数组,接收之后再定义就可以了。
redim preserve buf(128) 好像没写错吧
Buf = MSComm1.Input
a = Hex(Buf(0))
b = Hex(Buf(1))
c = Hex(Buf(2))
Me.Text4.Text = a + b + c上面才是我要的
谢谢各位了