Difference between revisions of "Command:Break"

From Lavish Software Wiki
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Syntax ==
+
#REDIRECT [[Control:While]]
{{CMD-DR|Break|Beginner|Intermediate|Beginner|Intermediate}}
 
Break
 
 
 
== Description ==
 
Used within a [[Command:While|While]] loop, "breaks" the loop and continues execution after the While.  Used within a [[Command:Switch|Switch]], "breaks" the switch and continues execution after the [[Command:EndSwitch|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 display as 2 beacause we broke out of the loop on the first iteration
 
Echo ${Count}
 
 
 
== See Also ==
 
*[[LavishScript:Commands|Commands]]
 
{{Command-Stub}}
 
[[Category:LavishScript]]
 
[[Category:LavishScript Commands]]
 

Latest revision as of 02:37, 13 September 2005

Redirect to: