BINTOC( ) Function

See Also

Converts an integer value to a binary character representation.

Syntax

BINTOC(nExpression [, nSize])

Returns

Character

Arguments

nExpression

Specifies the integer value to convert.

nSize

Specifies the length in characters of the returned character string.

nSize also determines the value you can specify for nExpression. The following table lists the permissible values for nSize and the corresponding range of values for nExpression:

nSize nExpression Range
1 –128 to 127
2 –32,768 to 32,767
4 (default) –2,147,483,648 to 2,147,483,647

If nSize is omitted, BINTOC( ) returns a character string composed of four characters.

Remarks

BINTOC( ) can be used to reduce the size of indexes for numeric fields containing integer data. For example, a numeric field named iPartCode might contain an integer value from 1 to 127 which corresponds to a parts classification code. BINTOC( ) lets you convert the value in the numeric field to a single character representation. For example, the following command creates an index with a one-character index key:

INDEX ON BINTOC(nPartCode,1) TAG PartCode