Syntax:
on timer(interval) fn userFunction
Description:
This statement designates a particular function as a timer-event handling routine. A timer-event handling routine is called periodically according to a time interval that you specify.
Setting interval
to a nonzero value causes timer events to be initiated. If interval
is positive, it specifies the timer interval in seconds. If interval
is negative, then abs(interval)
specifies the interval in ticks (a tick is approximately 1/60 second). Fractional values of interval
, if positive, are allowed. Setting interval
to zero does not initiate timer events; in this case, you can use the timer
statement to initiate timer events later in your program.
After timer events have been initiated, FutureBasic checks its internal timer whenever a HandleEvents
statement is executed. If FutureBasic checks its timer and finds that at least interval
seconds (or abs(interval)
ticks) have elapsed since the last time your designated routine was called, it calls your designated routine again.
Timer firings are not queued; they are lost if your application does not handle events for times greater than the interval
.
Note:
You can use the timer
statement to change the timing interval.
See Also:
timer; HandleEvents