Hi Group, (delphi 7 refers)
I haven't used delphi for some time. I have now a very basic app.
Three buttons on form, Start/Stop/Exit
When Start is pressed, the app enters a while(tick=true) do begin..someCode;...end; What I now require is that, when Stop is pressed, the appl abort thisstart loop and returns to the 'idle' state. I was thinking that, after Start is pressed, now the loop is being excuted, by pressing Stop, the stop proc will make tick=false, thus the Start loop will abort since the while(tick=true) is false.
(exit of course to end appl, this of course i know how to do.... :)
This stop proc does not result in the behaviour which I expected, it continues to stay in the loop. The only way, in delpi ide is to go to Run/Reset.
Else, Do away with Stop-btn, just use Startbtn to Start/End the loop. (The no stopbtn on from)
To omit using the Stop-btn, if it is possible, the StartBtn caption on idle to be eg 'Press to Start' Once the start-btn is pressed, i can change the caption of the start-btn to 'Press to Stop' Now the loop is entered. So, once you press the start btn, the caption changes to 'Press to stop', the app executes the start while(tick=true) do begin.... end; loop. Pressing the start-btn whilst in the loop, the loop to be aborted, start-btn caption reverting to 'Press to Start', system idle?
Is there someone here who can give the correct instruction/method/knowhow in order to exit the
startbutton loop, when Stop is pressed. (How do i know what the 'eventhandler name is?)
I am sure this in rather trivial basic, please help with some code samples or pointers?
Thank you very much.