var
b: Byte;
s: string;
IntI: Integer;
function ByteToBin(Value: Byte): string;
const
V: Byte = 1;
var
i: Integer;
begin
for i:= 7 downto 0 do
if (V shl i) and Value <> 0 then
Result := Result + '1'
else
Result := Result + '0';
end;
begin
b:= $c;
s:= ByteToBin( b );
for IntI:= 1 to Length( s ) do
begin
self.ListBox1.Items.Add( s[ IntI ] );
end;
end;
function ByteToBin(Value: Byte): string;
const
V: Byte = 1;
var
i: Integer;
begin
for i:= 7 downto 0 do
if (V shl i) and Value <> 0 then
Result := Result + '1'
else
Result := Result + '0';
end;