Decimal - A variable up to 8 bytes long to convert.
Length - The "Lenght" of bytes corresponding to the variable (1,2,4,8) -max. "Length" = 8
Trim - (Boolean)
TRUE = No alignment [Zeros Trimed from the Left]
FALSE = With Zeros aligned.
Returns the binary String == "Decimal".
Returns an empty string if 0 => "Length" > 8!
"Length" can be used to cut the high byte(s) off a multi-bytes variable.
Sample:FFFFFFFE00000001 =
1111111111111111111111111111111000000000000000000000000000000001 by "Length" = 8
********11111111111111111111111000000000000000000000000000000001 by "Length" = 7
If you wanna convert longer than 8 bytes like 'AnyType' or a memoryblock.
You have to modify the 8 bytes restriction in the source code.
But you have to make sure the returning string have enough space to hold the binary digits!
DEF MyVar32:UInt
MyVar32 = 0x0BF1F2F3
PRINT "Uint32:",ccBin$(MyVar32,4)
See
ccBin$_Demo.eba