青岛海会现货:vb6.0中如何将如原始数据为string型的(二进制)"110110101",想转换成代表的0-255十进制数据输出
来源:百度文库 编辑:神马品牌网 时间:2024/05/11 00:42:54
通过vb中的MSComm控件的Input只能用string型数组接收,想转换成0-255对应的数据
Function dec(n As String) As Long
For i = 1 To Len(n)
dec = dec * 2 + Val(Mid(n, i, 1))
Next
End Function