CRC16校验法在powerbuilder10.5中的写法。
翻译C语言的数据类型
翻译成pb代码的CRC16算法
global type calccrc from function_object
end type
forward prototypes
global function unsignedinteger calccrc (byte crcbuf, unsignedinteger crc)
end prototypes
global function unsignedinteger calccrc (byte crcbuf, unsignedinteger crc); byte i;
crc = BitEx(crc , crcbuf);
for i = 0 to 7
byte chk;
chk = Bitand(crc, 1);
crc = RShift(crc ,1