Converts a binary character representation to a numeric value.
CTOBIN(cExpression [, cFlags])
- Specifies the binary character representation to convert.
If the binary character representation specified with cExpression was generated using an 8 byte data type (currency or double, for example), include cFlags to control the type of value returned by CTOBIN(В ).
cExpression is an expression that is 1 byte long.
cExpression is an expression that is 2 bytes long.
cExpression is an expression that is 4 bytes long.
cExpression is an expression that is 8 bytes long.
cExpression is a double data type, and must be 8 bytes long.
CTOBIN(В ) returns a double data type value. This is the default for an expression that is 8 bytes long.
cExpression is a numeric data type, and must be 4 or 8 bytes long.
CTOBIN(В ) returns a numeric type value.
cExpression is a currency data type, and must be 8 bytes long.
CTOBIN(В ) returns a currency type value.
Reverses the binary expression.
Prevents the sign bit of number from being toggled (BITXOR).
Numeric. CTOBIN( ) returns a numeric value from a binary character expression.
The cFlags parameter is a character expression. The 'R' and 'S' settings are additive while the others are mutually exclusive. Character settings can be passed in either upper or lower case (e.g., 'R' or 'r'). Specifying a value of '1', '2' or '4' is not required, but is available as a convenience to provide feedback for the length of cExpression.
The following examples show various uses of the cFlags parameter.
? CTOBIN("A")&& same as CTOBIN("A","1") ? CTOBIN(BINTOC($12.34,"8"),"Y") ? CTOBIN(BINTOC(12.34,"8"),"B") ? CTOBIN(BINTOC(PI(),"BR"),"NRS")
You can use CTOBIN(В ) to convert a binary character representation created with BINTOC(В ) to its integer value. CTOBIN( ) can also be used when working with Win32 API routines where you might need to convert to or from a Win32 struct member. The 'R' and 'S' settings allow you to use CTOBIN ( ) to work more efficiently with these scenarios.