Futurebasic/Language/Reference/binstring

Function
✔ Appearance ✔  Standard ✔  Console

Syntax
binString$ = bin$( expr )

Description
This function returns a string of zeros and ones representing the binary value of, in "two's-complement integer" format (this is the native format in which integers are stored in FB). If  is in effect, an 8-character string will be returned. If  is in effect, a 16-character string will be returned. If  is in effect, a 32-character string will be returned.

Example
The chart below shows the results of  on some integer values. (If a non-integer  is used,   converts it to an integer before generating the string.) The chart assumes that   is in effect. The chart below shows the results of  on some integer values. (If a non-integer  is used,   converts it to an integer before generating the string.) The chart assumes that   is in effect. 1    -1     256     -256 To convert a string of binary digits into an integer, use the following technique: intVar = val&amp;( &quot;&amp;X&quot; + binaryString$ ) can be a (signed or unsigned) byte variable, short-integer variable or long-integer variable. Byte variables can handle a  up to 8 characters in length; short-integer variables can handle a   up to 16 characters in length; long-integer variable can handle a   up to 32 characters in length.