Autor Beitrag
elduchte
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 199

Win 2000, Win XP
Delphi 7
BeitragVerfasst: Mi 25.06.03 10:39 
Hallo,
wie kann ich ein Buchstabe (ein Wort) im ASCII-Code anzeigen/umwandeln lassen??

Danke
Andreas
MAlsleben
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 303

W2k,WinXP
D3 - DXE3 Enterprise
BeitragVerfasst: Mi 25.06.03 11:18 
Hi,

mit der Funktion ord('x').
Beispiel dazu ist in der Delphi Hilfe.

Gruß Micha.

_________________
Viele Wege führen nach Rom.
Tweafis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 647

WinXP + fbsd
Delphi 5 Prof
BeitragVerfasst: Mi 25.06.03 12:48 
bei einem ganzen wort geht das mit ner selbsgeschriebenen Funktion die ungefähr so aussehen kann:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
function GetAsciiString(s: string; hex: boolean = false): string;
var x:integer;
begin
  result := '';
  for x:=1 to length(s) do begin
    if hex then result:=result+'$'+IntToHex(ord(s[x]),2)+' '
    else result := result+IntToStr(ord(s[x]))+' ';
  end;
  result := trim(result);
end;


Bei Bedarf anpassen ;)

_________________
.: Es wird der Tag kommen, an dem wir es nicht mehr ändern können :.