You are here: Symbol Reference > _AbProc Namespace > Functions > AbIntToBin Function
ContentsIndexHome
PreviousUpNext
_AbProc.AbIntToBin Function
Send Feedback

Function AbIntToBin converts an integer value to a binary string

File
Pascal
function AbIntToBin(Value: Integer; Digits: Integer): String;
C++
AnsiString AbIntToBin(int Value, int Digits);
Parameters
Parameters 
Description 
Value: Integer 
The Value to convert 
Digits: Integer 
Number of digits (1..32, 0= no leading zero's) 
Returns

Binary string

Description

With AbIntToBin you can convert any integer value to a binary string. With the Digits parameter you adjust the number of digits in the resulting string. With digits = 0 the result string will not contain leading zeros.

Example
BinString := AbIntToBin(255, 0); // no leading zeros

 

BinString contains '11111111' 

 

BinString := AbIntToBin(255, 16); // filled with leading zeros, 16 digits total

 

BinString contains '0000000011111111'

Hard-& Software A.Baecker
What do you think about this topic? Send feedback!