TIMER_INTERVAL

TIMER_INTERVAL N,P

CHANGES THE TRIGGERING PERIOD OF THE SYSTEM OBJECT TIMER NUMBER N

  • Type: Command
  • Parameters: 2
  • Group: System Objects

ACTION

The command TIMER_INTERVAL N,P changes the triggering period of the system object TIMER designated by its number N: the TIMER will trigger at every P milliseconds.

Remark : The command does not depend on the TIMER status set by TIMER_ON or TIMER_OFF.

SYNTAX: TIMER_INTERVAL N,P

  • 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.
  • P = Number of milliseconds (integer or real). Must be greater than 0.

USE

  • The command TIMER_INTERVAL is used to change the TIMER period.

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.
  • If P is not a correct expression.
  • If P is less than or equal to 0.

EXAMPLE

rem every 3 seconds, displays a number from 1 to 10 then stops

label count

dim i%

rem create a TIMER

timer 1

rem change its period

on_timer 1,count

end

count:

i%=i%+1

print i%

if i%=5 then timer_off 1

return

SEE ALSO

TIMER

ON_TIMER

TIMER_ON

TIMER_OFF

TIMER_OFF_ALL