hello all, I need to convert this code to VB6, could anybody please help me!
its this function:
that calls this one:Code:#define BITS_PER_CHAR 8 unsigned short updcrc (unsigned short ch, unsigned short crc) { register short counter = BITS_PER_CHAR; register short temp = crc while (--counter >= 0) if (temp & 0x8000){ temp <<= 1; temp += (((ch <<= 1) & 0x0100) != 0); temp ^= 0x1021; } else{ temp <<= 1; temp += (((ch <<= 1) & 0x0100) != 0); } return (temp);
Code:#define BITS_PER_CHAR 8 unsigned short updcrc (unsigned short ch, unsigned short crc) { register short counter = BITS_PER_CHAR; register short temp = crc while (--counter >= 0) if (temp & 0x8000){ temp <<= 1; temp += (((ch <<= 1) & 0x0100) != 0); temp ^= 0x1021; } else{ temp <<= 1; temp += (((ch <<= 1) & 0x0100) != 0); } return (temp);




Reply With Quote