Autor Beitrag
DaRee
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21



BeitragVerfasst: So 30.03.08 12:17 
tach, sorry für den blöden titel, aber mir ist nichts eingefallen. ;)

Ich möchte gerne diese funktion austesten

www.delphi-treff.de/...mathematik/tipp/286/

aber die ausgabe möchte ich so haben, dass man eine zahl ins editfeld eingibt dann enter drückt und dann die quersumme berechnet und ausgegeben wird.

Habe das so versucht, aber er will nicht ;)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm8.EdtQuersummeKeyPress(Sender: TObject; var Key: Char);
begin
 if key = #13
  then
   begin
    LblQuersumme.Caption:=IntToStr(Quersumme(StrToInt(EdtQuersumme.Text)));
   end;
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: So 30.03.08 12:27 
Moin!

user profile iconDaRee hat folgendes geschrieben:
tach, sorry für den blöden titel, aber mir ist nichts eingefallen. ;)
Dann hast du dich evtl. nicht genug angestrengt, einen brauchbareren zu finden? :roll:

user profile iconDaRee hat folgendes geschrieben:
Habe das so versucht, aber er will nicht
Was ist denn passiert? Ist der Computer abgestürzt (=vom Tisch gefallen), ist der Bildschirm dunkel geworden, oder gar der Rechner explodiert?! :nixweiss:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
DaRee Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21



BeitragVerfasst: So 30.03.08 12:31 
heude n clown gefrühstück? :) Ne es passiert halt nichts.
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 30.03.08 13:14 
Der Aufruf stimmt so daran liegt es nicht.

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
Xion
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
EE-Maler
Beiträge: 1952
Erhaltene Danke: 128

Windows XP
Delphi (2005, SmartInspect), SQL, Lua, Java (Eclipse), C++ (Visual Studio 2010, Qt Creator), Python (Blender), Prolog (SWIProlog), Haskell (ghci)
BeitragVerfasst: So 30.03.08 13:26 
da ich damit schon sehr oft Probleme hatte: Versuche mal statt KeyPress KeyDown/KeyUp zu nehmen. Manche Tasten kommen unter manchen Events nicht an, ka wo da das System dahinter ist :?!?:

_________________
a broken heart is like a broken window - it'll never heal
In einem gut regierten Land ist Armut eine Schande, in einem schlecht regierten Reichtum. (Konfuzius)
DaRee Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21



BeitragVerfasst: So 30.03.08 13:52 
Wrde ich mal versuchen, nur wie arbeite ich mit KeyDown und KeyUp? Hab die ereignisse vorher nie benutzt...:(
Xion
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
EE-Maler
Beiträge: 1952
Erhaltene Danke: 128

Windows XP
Delphi (2005, SmartInspect), SQL, Lua, Java (Eclipse), C++ (Visual Studio 2010, Qt Creator), Python (Blender), Prolog (SWIProlog), Haskell (ghci)
BeitragVerfasst: So 30.03.08 13:58 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
 if Key=13 then
   beep;
end;


//Edit: wobei, KeyDown wäre vielleicht besser, so passiert erst was, wenn du die Taste los lässt

_________________
a broken heart is like a broken window - it'll never heal
In einem gut regierten Land ist Armut eine Schande, in einem schlecht regierten Reichtum. (Konfuzius)
DaRee Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21



BeitragVerfasst: So 30.03.08 15:01 
Danke sehr! Aber leider geht es so auch nicht :(
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 30.03.08 15:10 
Wie sieht den dein kompletter Quelltext aus.

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)