createTimer function


createTimer

createTimer (interval, function-to-call, parameters...)

Creates a timer that executes function-to-call after interval milliseconds with parameters...

Parameters:

interval - an integer containing the time interval in milliseconds.

function-to-call - a string containing the function to call.

parameters - a variable number of parameters that are passed to the timer function.

Returns:

Returns a variable containing the timer id. This may be passed to cancelTimer.

Example:

Example

The following code shows how to create a timer that is fired in 30 seconds.

id = createTimer(30000, "escalate", message)

The timer function escalate is an example of how to change the color of a message.

Example

function escalate(msg)
select
when msg.COLOR == GREEN then
msg.COLOR = YELLOW
when msg.COLOR == YELLOW then
msg.COLOR = WHITE
when msg.COLOR == WHITE then
msg.COLOR = RED
end
return 0

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*