ULongIntToBin

Syntax:

    stringvar = ULongIntToBin(ULongIntvar)

Command Availability:

Available on all microcontrollers

Explanation:

The ULongIntToBin function creates a string of a ANSI (32) characters. The function converts a number to a string consisting of ones and zeros that represents the binary value.

Note: Supports ULongInt variables only. For BYTE variables use VarToBin, for WORD variables use VarWToBinand for INTEGER variables use VarIntegerToBin

Example:

    string = ULongIntToBin( 1 )   ' Returns "00000000000000000000000000000001"          ' <<< the ULongIntToBin instruction

    string = ULongIntToBin( 254 ) ' Returns "00000000000000000000000011111110"

Key line: string = ULongIntToBin( 1 ) — converts the ULongInt value 1 into a full 32-character string of ones and zeros; unlike VarToBin, VarWToBin, and VarIntegerToBin, this variant always produces exactly 32 binary digits, matching the width of a ULongInt.

See Also: