Autor Beitrag
mhsteuer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23



BeitragVerfasst: Di 23.09.03 10:40 
Hallo,
kann mir mal jemand erklären, wie man eine repeat-until-Schleife solange laufen lassen kann, bis man eine Taste drückt (bzw. mit der Maus klickt)??? (wie keypressed in TP)

Danke Morten

_________________
Mittsommernacht
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Di 23.09.03 11:03 
Du musst einfach eine globale Bool-Variable cancel haben, dann einfach als Schleife:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
cancel=false;
repeat
   ....
   until cancel;


Mitten in der Schleife brauchst Du ein
ausblenden Delphi-Quelltext
1:
application.ProcessMessages;					

Jetzt machste nen Button, in dessen Click-Event Du cancel auf True setzt.
catweasel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 487
Erhaltene Danke: 1

Win 7 64bit
Delphi 7 Second Sedition V7.2
BeitragVerfasst: So 14.03.04 23:27 
Und wie macht man das wenn es ein Tastendruck sein soll...
Wie soll man da die Bool Vaiable auf den Abbruchwert bekommen ?

Catweasel

_________________
Pommes werden schneller fertig wenn man sie vor dem Frittieren einige Minuten in siedendes Fett legt.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: So 14.03.04 23:50 
Hallo!

Dann setzt Du die Variable im OnKeyPress-Ereignis auf true.

MfG
Peter

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
catweasel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 487
Erhaltene Danke: 1

Win 7 64bit
Delphi 7 Second Sedition V7.2
BeitragVerfasst: Mo 15.03.04 00:10 
Danke Peter. Habs gerade geschnallt.. Is schon etwas spät *augenzufall* :-)

Catweasel

_________________
Pommes werden schneller fertig wenn man sie vor dem Frittieren einige Minuten in siedendes Fett legt.