>BINTOC() will convert an integer to a 1, 2, or 4-byte character. Default 4 (if no second parameter).
Unfortunately, BINTOC() isn't usable when dealing with C-type WORD/DWORD for two reasons.
1. In order to limit the valid return values, BINTOC() starts the high-order bit at character 128. If you pass this value, it will read it incorrectly and most likely fail.
2. It returns the character representation in the wrong order. It returns values translated high order to low order. In this way, 1000 means (1*10^3)+(0*10^2)+(0*10^1)+0. For library routines to read it, it needs to be the other way around. 1000 should mean 1+(0*10^1)+(0*10^2)+(0*10^3).
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao