Andy,
You can encase your mainloop code in a Do/Loop While with a test of the WakeupFlag.
Then when the WakeupFlag is set at timeout, the loop will terminate and you can replace the "GOTO mainloop" instruction with a GOTO bedtime as the last instruction of mainloop.
Or
You can use a Do/Loop with an "Exit" statement in place of the "GOTO bedtime" instruction in the timeout1 If/Then test. Still replace the "GOTO mainloop" instruction with a "GOTO bedtime" instruction as the last instruction in mainloop.
Also, I overlooked the fact that you are jumping to CACHE twice a day and CACHE falls through to bedtime without setting the WakeupFlag. You shou set the WakeupFlag before you jump to CACHE.
What kind of problems are you having?
Bookmarks