Flow Control
There are a number of statements that can affect the flow of statement execution within a script.
Changing the Flow of a Repeat Loop
In addition to the statements listed here, return
and pass
statements will terminate execution of a repeat loop (see Messages).
Next Repeat
Causes any statements following the next repeat
statement, down to the end repeat
, to be skipped and execution to jump directly back to the beginning of the current (innermost) repeat loop. Execution then continues with the next iteration.
Syntax:
next repeat
Exit Repeat
Terminates execution of the current (innermost) repeat loop. Script execution proceeds with the next statement following end repeat
.
Syntax:
exit repeat
Exiting a Handler
Exit Handler
Behavior: Terminates execution of the current handler. Execution continues in the calling handler.
Syntax:
exit handlerOrFunctionName
exit [handler | script | on | function | getProp | setProp]
If handlerOrFunctionName or a handler type is given, it must match the name or type of the current handler.
Examples:
exit handler
exit myFancyFunction