VFP写的CRC16校验码,已验证完全可用n16CRC = 0x0000FFFF FOR i=1 TO nLen n16CRC = BITOR((BITAND (n16CRC, 0xFF00)) ,(BITXOR(BITAND (n16CRC, 0x00FF),val(cStr(i))))) *!* WAIT WINDOW n16CRC FOR j=1 TO 8 IF BITAND(n16CRC,1)==1 n16CRC = BITXOR(BITRSHIFT(n16CRC,1)