Error getting tags :
error 404Error getting tags :
error 404 idle | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
idle
Basics
Expander triangle
Type
Message
Syntax
idle
Introduced
1.0
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Sent periodically to the current card if no other message is being sent.
Examples

Additional Comments
Expander triangle

Handle the idle message to check constantly on the status of an object, the content of a variable, and so forth, or to do periodic tasks.

Comments:

The period between idle messages is specified by the idleRate and idleTicks properties.

Note: Usually, it is easier and more efficient to use the send in time form of the sendcommand than to use an idlehandler, especially if a task needs to be executed at regular intervals. This example shows an idlehandler that updates a clock timer:

on idle -- avoid if possible

global startTime

if the seconds > startTime + 60 -- 60 seconds have gone by

put the time into field "Clock Face"

put the seconds into startTime

end if

pass idle

end idle

The following example does the same thing more efficiently, since it only needs to handle a single message every sixty seconds:

on updateClock -- a better way

put the time into field "Clock Face"

send "updateClock" to me in 60 seconds

end updateClock

Executing an idle handler slows down other Revolution actions, so handle the idle message only in the rare cases where the send command cannot be used instead.

Note: If there is no idlehandler anywhere in the message path, no idlemessage is sent.

User Comments
Expander triangle