Thema: Delphi String To Byte ...

Einzelnen Beitrag anzeigen

Benutzerbild von Union
Union

Registriert seit: 18. Mär 2004
Ort: Luxembourg
3.490 Beiträge
 
Delphi 7 Enterprise
 
#4

Re: String To Byte ...

  Alt 29. Feb 2008, 11:11
Oder auch so:
Delphi-Quellcode:
function CharToBin(AChar : char): string;
var
  i: Integer;
begin
  SetLength(result, 8);
  for i := 1 to 8 do
  begin
    if ((Byte(AChar) shl (i-1)) shr 7) = 0 then
      result[i] := '0'
    else
      result[i] := '1';
  end;
end;
Ibi fas ubi proxima merces
sudo /Developer/Library/uninstall-devtools --mode=all
  Mit Zitat antworten Zitat