Error getting tags :
error 404Error getting tags :
error 404 break | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
break
Basics
Expander triangle
Type
Control Structure
Syntax
break
Introduced
1.0
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Skips the rest of the current switch structure and goes to the statement following the end switch.
Examples

case thisVariable
switch true
doSomething
break
case false
doSomethingElse
break
end switch

Additional Comments
Expander triangle

Use the break control structure to end each case section in a switch structure.

Form:

The word break appears on a line by itself, within a case section of a switch control structure.

Comments:

A switch control structure consists of one or more conditions. For each condition, a set of statements is executed. The break control structure ends this set of statements and breaks out of the switch structure.

If no break appears, Revolution executes each set of statements in the following case sections, whether or not the condition in the case is true. This means that if you leave out the break control structure, more than one case in the switch statement may be executed. Occasionally, this is desirable, but usually you should include the break control structure at the end of each case, to ensure that only one set of statements is executed.

Note: The breakcontrol structure is implemented internally as a command and appears in the commandNames.

The break command should not be used outside a switch structure: such use is nonstandard, so it may not be apparent to whoever reads the code that the use is intentional. If it appears outside a switch structure, it has the same effect as the exit control structure.

User Comments
Expander triangle