If _EXIT just ignored the SLEEP and _DELAY statements, if that's possible, you would not need the ON TIMER part at all.
Also, there was another thread where the author was trying to decide on using SLEEP vs _DELAY for very long pauses. _DELAY uses a little less resources, but what if he had to break into the program. SLEEP would allow a keypress to break the delay, but _DELAY would require the ON KEY() approach, as posted above, but without the added _EXIT function.
The otehr thing I wanted to mention is the process coded above is clunky. It appears ON TIMER fights a bit with ON KEY(), causing a noticeable delay in executing the key input. That's why I printed the instructions to hold the Esc down, instead of just pressing it. Is there any method to smooth it out?
Pete
Title: Re: Could _EXIT be made to ignore SLEEP and _DELAY?
Post by: SMcNeill on January 26, 2021, 03:37:33 pm
Isn't this just a simple case of Write your own function for your specific needs?
Of course, to do this type of thing without midnight overflow, I'd suggest making use of my ExtendedTimer routine, but you can always code around it the OldSkool(tm) way, which you seem to prefer...
Title: Re: Could _EXIT be made to ignore SLEEP and _DELAY?
Post by: Pete on January 26, 2021, 03:49:52 pm
Nice, and yes, I have plenty of those timer routines, midnight 86400 adjustment included. So for me, I'd never use _DELAY for anything else that short pauses for display effect.
I'm just thinking the QB64 language could be improved by having the ON TIMER with ON KEY() play better together, without the lag issues with key input, or the _EXIT could be improved by ignoring SLEEP and _DELAY statements, if that's even possible.
So this is not for my personal use, just in regards to the language, for anyone here who still works in that area.