VB中的一段代码,请问如何用PB代码来写?
VB代码如下:
For Ii = 0 To 16
out1 = out1 + outstr(Ii)
If out1 >= 256 Then
out1 = out1 - 256
End If
Next Ii
out1 = 256 - out1
If out1 <> outstr(17) Then Exit Sub
-------------------------------------------------------------备注
Dim Ii As Integer
Dim outstr
outstr = MSComm1.Input //outstr是读入的是二进制数据共18个字节的长度
out1 没有定义,直接使用
以上这段程序是利用Mscomm32.ocx从汽车衡读取承重信息程序中的一段,以上这段是其中的数据校验过程!