Error getting tags :
error 404Error getting tags :
error 404 pass | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
pass
Basics
Expander triangle
Type
Control Structure
Syntax
pass messageName [to top]
Introduced
1.0
Changed
2.1
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Stops the current handler and passes the message to the next object in the message path.
Examples

Additional Comments
Expander triangle

Use the pass control structure to end a handler while letting the message continue along the message path.

Form:

The pass statement appears on a line by itself, anywhere inside a handler.

Parameters:

The messageName is the name of the handler in which the pass control structure appears.

Comments:

When the pass control structure is executed, any remaining statements in the handler are skipped. Hence, the pass control structure is usually used either at the end of a handler or within an if control structure.

Use the pass control structure at the end of a handler to make sure that objects further up the message path, or Revolution itself, receive the message. For example, if a stack's script contains a closeCard handler that does housekeeping tasks, and a particular card needs to perform additional tasks if the stack is closed when on that card, the card's closeCard handler can perform those additional tasks, and then use the pass control structure to let the closeCard handler in the stack's script receive the message and be executed. The following example demonstrates the idea:

on closeCard -- in card script

put empty into field "Search"

pass closeCard -- give stack script a crack at it

end closeCard

Built-in messages that perform a task, such as keyDown and closeStackRequest, must be received by the engine or the task will not be performed. For example, Revolution enters a typed character into a field when it receives the keyDown message, and starts closing a stack when it receives the closeStackRequest message. For this reason, if you create a handler for a built-in message that performs a task, make sure to use the pass control structure to ensure that the engine receives the message after the handler is finished with it.

Similarly, if you set a custom property, the setProp trigger must be received by the engine, or the custom property will not be set. This means that if you create a setProp handler to intercept requests to set a custom property, the property is not set unless you include a pass control structure in the setProp handler.

When a handler executes a pass statement, the message is passed to the next object in the message path. If you use the pass...to top form of the pass control structure, the message is passed directly to the engine, without being passed through any other object in the message path.

To halt the current handler without passing the message on through the message path, use the exit control structure instead. To halt the current handler and return a result, use the return control structure instead.

Important! You cannot use the passcommand to pass a message that was originally sent with the sendcommand.

Changes to Revolution:

The pass...to top form was added in version 2.1.

User Comments
Expander triangle