function IntToBin(Value: LongInt;
Digits: Integer): String;
var
i: Integer;
begin
Result:='';
for i:=Digits downto 0 do
if Value and (1 shl i)<>0 then
Result:=Result + '1'
else
Result:=Result + '0';
end;
Digits: Integer): String;
var
i: Integer;
begin
Result:='';
for i:=Digits downto 0 do
if Value and (1 shl i)<>0 then
Result:=Result + '1'
else
Result:=Result + '0';
end;