cathalturi
Programmer
I'm trying to have a loop check the comport at least once a second in an infinite loop. I would like to stop the loop by pressing a button on the same window. Addtionaly exiting via the ESC key would be great.
I've tried numerous variations. Either the loop can't be interrupted or it will only run when the 'Stop' key / button is pressed.
Although this may sound trivial - it's got me puzzled.
My example: ( The String-Counter is a substitute for the comport check)
QS_StopButton = 0
QS_TestString = 0
LOOP UNTIL KEYCODE() = EscKey
IF QS_StopButton = 1 THEN BREAK.
QS_TestString = QS_TestString + 1
DISPLAY()
END
Pressing the STOP button will asign QS_StopButton = 1
I've tried numerous variations. Either the loop can't be interrupted or it will only run when the 'Stop' key / button is pressed.
Although this may sound trivial - it's got me puzzled.
My example: ( The String-Counter is a substitute for the comport check)
QS_StopButton = 0
QS_TestString = 0
LOOP UNTIL KEYCODE() = EscKey
IF QS_StopButton = 1 THEN BREAK.
QS_TestString = QS_TestString + 1
DISPLAY()
END
Pressing the STOP button will asign QS_StopButton = 1