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 TForm1.Dec2Bin(iDec: Integer): string;
begin
Result:='';
while iDec>0 do
begin
Result:=IntToStr(iDec and 1)+Result;
iDec:=iDec shr 1;
end;
end;