Autor Beitrag
whitesnake
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40

Win XP Home
Delphi 7 Personal, HTML
BeitragVerfasst: Mo 23.10.06 15:31 
hi,
also ich hänge gerade bei der o.g. aufgabe...
man brauch ja, um ein zeichen in einen ascii wert zu ändern, die funktion CHR(x) wobei x vom typ CHAR sein soll?

so und umgekehrt brauch man die funktion ORD(y) wobei y vom typ INTEGER sein soll?

falls richtig wills mir einfach nicht einfallen wie ich das realisieren kann, klingt vllt blöd, aber hab total das brett vorm kopf... auch wegen den typen CHAR und INTEGER...

hat vllt jemand code schnipsel o.Ä. in einfachem code (also nix mit komplizierten funktionen o.Ä.) ??

wäre euch sehr dankbar :)
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Mo 23.10.06 15:47 
Chr(65) -> gib ein 'A' aus !
Ord('A') -> gibt 65 aus!

einfach mal Ord und Chr in Delphi eingeben und F1 drücken!

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
whitesnake Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40

Win XP Home
Delphi 7 Personal, HTML
BeitragVerfasst: Mo 23.10.06 15:50 
ja hmm das meint ich etwas anders...aber egal... ich glaub ich weiß schon wie...allerdings weiß ich nicht wie ichs hinbekomme, dass wenn ich die entertaste drücke oder die return taste, dass dafür der code ausgegeben wird (in nem edit feld)
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 23.10.06 15:55 
KeyPreview der Form auf True, und dann sowas:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  edit1.text := IntToStr(Key);
  key := 0;
end;

_________________
We are, we were and will not be.
whitesnake Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40

Win XP Home
Delphi 7 Personal, HTML
BeitragVerfasst: Mo 23.10.06 18:22 
danke, klappt zwar nich aber egal... ähhhhmm...

wie kann ich denn, wenn ich die leertaste z.b. hab, das ascii zeichen der leertaste in der ORD funktion darstellen`?

wäre das
ORD( );

oder
ORD(' ');

nichts klappt :S
stifflersmom
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 194

XP /XP PRO/ SuSE div.
D1 - D7, BDS 2006
BeitragVerfasst: Mo 23.10.06 18:40 
Du solltest mal den Tipp beherzigen und versuchen die OH zu ORD und CHR zu verstehen.
Aber sei's drum;

Platzier ein Edit auf Deinem Formular und im KeyPress-Ereignis des Edit-feldes gibst Du folgendes ein

ausblenden Delphi-Quelltext
1:
ShowMessage(IntToStr(Ord(Key)));					


Dann siehst Du auch welcher Ascii-Wert hinter deinem angesprochenem Leerzeichen steht.

Moin
Saubäär
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 376



BeitragVerfasst: Mo 23.10.06 18:42 
Brauchst du Code oder reicht ein Programm?
Auf meiner HP habe ich im Dowloadbereich ein kleines Proggi. (Allerdings ohne Code)

Gruß

Saubäär
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Mo 23.10.06 19:50 
Hier mal Prog und Source ist auch unter
www.delphi-forum.de/....php?p=316137#316137
zu finden ohne Source.
Blackheart666
Einloggen, um Attachments anzusehen!