BinToC(), CToBin()
These two functions let you change between integers and a character representation of their values. Their raison d'etre is to allow more efficient indexing.
Usage |
cCharValue = BinToC( nInteger [, nChars] ) nInteger = CToBin( cCharValue ) |
Parameter |
Value |
Meaning |
nInteger |
Numeric |
The number to be converted to character or the result of the conversion. |
cCharValue |
Character |
The character-string representation of nInteger. |
nChars |
1 |
Use one character to represent nInteger. |
2 |
Use two characters to represent nInteger. |
|
4 or omitted |
Use four characters to represent nInteger. |
Example |
? BINTOC( -128, 1) && returns CHR(0) ? BINTOC(127,1) && returns CHR(255) ? CTOBIN("zzzz") && returns -92636550 * Suppose you have an integer primary key field, iPKey INDEX ON BINTOC(iPKey) TAG iPKey |
See Also |