发布于 2006-11-08 17:02:07
0楼
城版:你好。在VB中是可以用BYTE型的,在VB中使用如下代码,可以用MSCOMM实现BYTE型数据的发送:
Dim uc_Output() As Byte
Dim temp As Variant
ReDim uc_Output(2)
uc_Output(0) = &HEB
uc_Output(1) = &H90
uc_Output(2) = &H61
temp = uc_Output
MSComm.Output = temp
但在VBS中却不能这样用,首先Dim uc_Output() As Byte这样的定义就通不过语法检查,不能使用 As Byte,只能使用Dim uc_Output() 定义,这说明VB与VBS在变量定义方面并不能通用,看来完全照搬VB的方法肯定是不行的了。
城版你经验丰富,能不能试着解决一下?