Convert Binary -> Integer  

Send By: Q3 Team
Web : http://www.q3.nu
Email: dlib@q3.nu
Date: 03/08/99

Tip accessed 481 times

 



 function BinToInt(Value: String): Integer;
 var
   i,Size: Integer;
 begin
   Result:=0;
   Size:=Length(Value);
   for i:=Size downto 1 do
     if Value[i]='1' then Result:=Result+(1 shl (Size-i));
 end;



A call example:


   Label1.Caption:=IntToStr( BinToInt('00000101') );