TIMER_ON

TIMER_ON N

MAKES ACTIVE THE SYSTEM OBJECT TIMER NUMBER N

  • Type: Command
  • Parameter: 1
  • Group: System Objects

ACTION

The command TIMER_ON N makes active the system object TIMER designated by its number N: the TIMER will trigger periodically.

SYNTAX: TIMER_ON N

  • N = system object number (integer or real). Must be greater than 0 and less than or equal to the allowed maximum number of system objects.

USE

  • The command TIMER_ON is used to make active a TIMER.

ERROR

  • If number N is not a correct expression.
  • If number N exceeds the allowed maximum number of system objects.
  • If number N is less than 0.
  • If system object number N does not exist.
  • If the system object number N is not of the type : TIMER.

EXAMPLE

rem after 5 seconds, displays each second a number from 1 to 10 then stops

label count

dim i%

rem create a TIMER

timer 1

rem the TIMER is not activated

timer_off 1

on_timer 1,count

rem wait for 5 seconds

wait 5000

rem the TIMER is activated

timer_on 1

end

count:

i%=i%+1

print i%

if i%=10 then timer_off 1

return

SEE ALSO

TIMER

ON_TIMER

TIMER_INTERVAL

TIMER_OFF

TIMER_OFF_ALL