Autor Beitrag
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Di 09.08.05 10:49 
Hallo,

jetzt mal alle im Überblick:
ausblenden Delphi-Quelltext
1:
2:
3:
OnKeyPress(...; var Key: Char);     // >>> key := #0;
OnKeyDown(...; var Key: Word;...);  // >>> key := 0;
OnKeyUp(...; var Key: Word;...);    // >>> key := 0;

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Di 09.08.05 10:50 
user profile iconcherry hat folgendes geschrieben:
.. ok, ich probiers nochmal...

Jawoll... Tu' das... ;)

@user profile iconCK_CK: War nicht böse gemeint. ;)
cherry Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 136

WinXP - Professional
RAD Studio 2009
BeitragVerfasst: Di 09.08.05 10:52 
aber wenn ich es im OnKeyPress Ereignis mache, funktioniert die If Abfrage
mit vk_return leider nicht!

ausblenden Delphi-Quelltext
1:
 If key = ???  then					


Wie regle ich das jetzt?
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Di 09.08.05 10:54 
ausblenden Delphi-Quelltext
1:
2:
3:
if Key = #13 then
begin
[...]

;)
cherry Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 136

WinXP - Professional
RAD Studio 2009
BeitragVerfasst: Di 09.08.05 10:56 
Cool

Jetzt klappt alles bestens!
Danke für eure Hilfe...

Schönen Tag noch..
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Di 09.08.05 10:59 
user profile iconcherry hat folgendes geschrieben:
Danke für eure Hilfe...

Kein Problem. ;)

user profile iconcherry hat folgendes geschrieben:
Schönen Tag noch..

Joa, dir auch. ;)

slt, WeBBy
DaRkFiRe
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 526

WinXP Home & Professional
C, C++, Delphi
BeitragVerfasst: Di 09.08.05 11:07 
@WebSpace: das mit Ord is nich Dein Ernst?
Ord wandelt Char in ASCII Code (also BYTE) um (Typecast von CHAR nach BYTE)

Ach ja - und wie Lannes schon sagte
Keypress: Key:=#0, KeyUp/Down: Key:=0

@CK_CK: Ord(#0) gibt 0 zurück, also bitte, warum nicht gleich 0 schreiben? Wenn Du Glück hast, optimiert der Delphi-Compiler das.

_________________
Lang ist der Weg durch Lehren - kurz und wirksam durch Beispiele! Seneca
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Di 09.08.05 11:14 
user profile iconDaRkFiRe hat folgendes geschrieben:
@WebSpace: das mit Ord is nich Dein Ernst?
Ord wandelt Char in ASCII Code (also BYTE) um (Typecast von CHAR nach BYTE)

Blablubb... Da ist einiges verrutscht... ;) Ich wusste nur, dass es falsch war, hab aber den gewünschten Wert mit dem vorhandenen verwechselt... :roll:

Ord(X: Ordinal) will ein Char als Parameter. Das ist richtig. Somit ist also #0 korrekt. Jedoch bekommen wir als Rückgabewert von Ord(X: Ordinal) ein Integer (Char :arrow: Integer). Wir wollen aber kein Integer. Wir wollen ein Char. Hab's jetzt verbessert... ;)

Danke! :tongue: