As already asked David in a comment of an answer here, I\'m really interested on how this function works, since I can\'t seem to get the same (correct) values if changing re
function IntToBin2(Value: Integer): string;
var
i, pol: Integer;
begin
Result:= '';
for i := 1 to Value do
begin
pol:= Value div 2;
Result:= IntToStr(Value - pol * 2) + Result;
Value:= pol;
if pol = 0 then
Break;
end;
end;