mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-09 14:00:17 +00:00
If a timer expires while stopped, it should trigger when TIMER ON is run. Instead, on QB64 it triggers randomly after the TIMER ON happens. The basic issue is that `qbevent` needs to be set to trigger the timer, but TIMER ON doesn't do that. The regular timer logic that does that already set it when the timer expired while sleeping, so it won't set it again. The simplest solution is to just alway set qbevent = 1 when TIMER ON is done. It's slightly less efficent but doesn't hurt to set it even when there are no timers that expired. Fixes: #293
15 lines
188 B
QBasic
15 lines
188 B
QBasic
$Console:Only
|
|
|
|
On Timer(2) GoSub timerhand
|
|
|
|
' This first delay should not matter
|
|
_Delay 3
|
|
Timer On
|
|
|
|
' The timer should be triggered twice
|
|
_Delay 5
|
|
System
|
|
|
|
timerhand:
|
|
Print "Timer!"
|
|
return
|