function IntToBin( Value: integer; Digits: integer ): string;
begin
result := StringOfChar ( '0', digits ) ;
while value > 0 do begin
if (value and 1) = 1 then
result[digits] := '1';
dec (digits) ;
value := value shr 1;
end;
end;

I ussually dont post anything here often, just get everything off of everyone elses questions,
but I'm having a strange problem that im scratching my head over,