CREATES A SYSTEM OBJECT TIMER AND ALLOCATES IT NUMBER N AS REFERENCE
ACTION
The command creates a system object TIMER, and allocates it a number N. The number N will be used to designate the TIMER.
The created TIMER can then be used through the appropriated commands (ON_TIMER, TIMER_INTERVAL, TIMER_ON, TIMER_OFF), but is not visible.
A TIMER can generate the event : ON_TIMER.
Remark 1: the TIMER is active when created and its period is 1000 milli-seconds.
Remark 2: a TIMER can be deactivated by TIMER_OFF and reactivated by TIMER_ON.
Remark 3: its period (in milli-second) can be modified by TIMER_INTERVAL.
SYNTAX:
TIMER N
USE ERROR EXAMPLE
rem each second, displays a number from 1 to 10 then stops
label count
dim i%
rem create a TIMER
timer 1
on_timer 1,count
end
count:
i%=i%+1
print i%
if i%=10 then timer_off 1
return
TIMER
TIMER N
SEE ALSO
ON_TIMER
TIMER_INTERVAL
TIMER_ON
TIMER_OFF
TIMER_OFF_ALL