Difference between revisions of "Command:Break"
Jump to navigation
Jump to search
Line 13: | Line 13: | ||
VarCalc Count ${Count}+1 | VarCalc Count ${Count}+1 | ||
break | break | ||
− | Echo this line will not be echoed due to the above break command | + | Echo this line will not be echoed due to the above break command and the loop will stop |
} | } | ||
While "${Count}<10" | While "${Count}<10" | ||
+ | ; Count below will diaplay as 2 beacause we broke out of the loop on the first iteration | ||
+ | Echo ${Count} | ||
== See Also == | == See Also == |
Revision as of 21:42, 16 July 2005
Contents
Syntax
Break | |
Usage | Beginner |
Level of Understanding | Intermediate |
Computer Savvy | Beginner |
Logic | Intermediate |
Break
Description
Used within a While loop, "breaks" the loop and continues execution after the While. Used within a Switch, "breaks" the switch and continues execution after the EndSwitch. This command is not valid at any other time.
Examples
Declare Count int 1 Do { Echo ${Count} VarCalc Count ${Count}+1 break Echo this line will not be echoed due to the above break command and the loop will stop } While "${Count}<10" ; Count below will diaplay as 2 beacause we broke out of the loop on the first iteration Echo ${Count}