Difference between revisions of "Command:While"

From Lavish Software Wiki
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== Syntax ==
+
#REDIRECT [[Control:While]]
{{CMD-DR|While|Intermediate|Intermediate|Beginner|Intermediate}}
 
While <condition>
 
 
 
== Description ==
 
Conditionally returns execution to its matching [[Command:Do|Do]] command, effectively creating a loop, depending on the value of an expression. The condition is run through a [[LavishScript:Mathematical Formulae|math calculator]].  If the result is zero, execution continues after the While command; otherwise it returns to Do. A command blocks must be used between the Do and While, which begin with a '''{''' and end with a '''}'''.
 
 
 
 
 
== Examples ==
 
Declare Count int 1
 
Do
 
{
 
  Echo ${Count}
 
  VarCalc Count ${Count}+1
 
}
 
While "${Count}<10"
 
 
 
== See Also ==
 
*[[Command:Break|Break]]
 
*[[Command:Continue|Continue]]
 
*[[Command:Do|Do]]
 
*[[LavishScript:Commands|Commands]]
 
*[[LavishScript:Mathematical Formulae|Mathematical Formulae]]
 
 
 
{{Command-Stub}}
 
[[Category:LavishScript]]
 
[[Category:LavishScript Commands]]
 

Latest revision as of 02:37, 13 September 2005

Redirect to: