versuch es doch einmal mit dieser Simpellösung:
Delphi-Quellcode:
function Byte2Bin(inbyte:byte):string;
const
bina:array [0..1] of char=('0','1');
begin
result:=' ';
result[1]:=bina[(inbyte shr 7) and $01];
result[2]:=bina[(inbyte shr 6) and $01];
result[3]:=bina[(inbyte shr 5) and $01];
result[4]:=bina[(inbyte shr 4) and $01];
result[5]:=bina[(inbyte shr 3) and $01];
result[6]:=bina[(inbyte shr 2) and $01];
result[7]:=bina[(inbyte shr 1) and $01];
result[8]:=bina[(inbyte and $01)];
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i : integer;
begin
for i:=1 to length(label1.caption) do
label2.Caption:=label2.Caption+' '+Byte2Bin(byte(label1.Caption[i]));
end;
Gruß
K-H