Error getting tags :
error 404Error getting tags :
error 404 cancel | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Expander triangle
cancel messageQueueID
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
None required
Removes a message that was queued with the send command and is waiting to be sent.

cancel 2298
cancel item 1 of last line of the pendingMessages

Additional Comments
Expander triangle

Use the cancel command to get rid of messages that were set up but are no longer required.


The messageQueueID is the ID number of the message.


The ID number of the message is returned by the send command that sent the message. This number is also the first item of the line corresponding to the message in the pendingMessages function.

All pending messages are automatically canceled when the application quits.

It is common to need to cancel a number of messages when leaving a card or stack, if the messages only pertain to that card or stack. For example, you might have queued a number of messages that create an animated display on the current card, and need to cancel them when the user goes to another card. The best solution in a case like this is to place each message ID number in a global variable or custom property at the time the message is sent. Then you can cancel all those messages in a repeat loop:

on closeCard

global myPendingMessages -- you've stored the message IDs here

repeat for each line thisMessageID in myPendingMessages

cancel thisMessageID

end repeat

end closeCard

You can also cancel all pending messages with a similar handler, using the pendingMessages function:

on closeCard -- brute-force method

repeat until the pendingMessages is empty

cancel item 1 of line 1 of the pendingMessages

end repeat

end closeCard

Caution! Revolution uses the sendcommand to control Animation Builder animations and to control aspects of the development environment, so canceling Revolution's pending messages may cause unexpected behavior. All of Revolution's messages begin with "rev", so before canceling a pending message, if you're using the development environment, make sure the message name does not begin with "rev".

User Comments
Expander triangle