settimer
| settimer | 
  Purpose
 
 
 Create or update a timer.
 
 
  Synopsis
 
 function settimer(tid:integer, dur:integer, rep:boolean):integer
 function settimer(dur:integer, rep:boolean):integer
 
  Arguments
 
 | 
     tid 
     | 
     A timer identifier
     | 
| 
     dur 
     | 
     A duration in milliseconds
     | 
| 
     rep 
     | 
     Decides whether the timer will be armed one time only or automatically repeated
     | 
  Return value
 
 
 Timer identifier as a positive integer
 
  Further information
 
 
 1. This function creates or updates an
 interval timer: after a timer has been armed by a call to this routine an event of class
 EVENT_TIMER
  is scheduled for being sent to the model after the specified amount of time has elapsed. The value of such an event is the timer identifier
 tid. Note that the system will not emit a new event if an identical event is already in the queue.
 
 
 2. If the option
 rep is set to
 false the timer is released after its termination, otherwise it is immediately re-armed with the same interval after each expiration until it is explicitly cancelled (see
 canceltimer).
 
 
 3. If the provided identifier
 tid is not positive a new timer is created with a newly generated identifier, this corresponds to the behaviour of the second form of this function.
 
 
 4. When the provided identifier corresponds to an existing timer, this one is first cancelled with a call to
 canceltimer before being re-created with the new properties.
 
 
  Related topics
 
  
  Module
 
  
