Difference between revisions of "Command:Do"

From Lavish Software Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
== Syntax ==
 
== Syntax ==
 
{{CMD-DR|Do|Beginner|Intermediate|Beginner|Intermediate}}
 
{{CMD-DR|Do|Beginner|Intermediate|Beginner|Intermediate}}
 +
Do
  
 
== Description ==
 
== Description ==
 +
Used in conjunction with [[Command:While|While]] to create a While loop.  The "Do" marks the beginning, whereas "While" marks the end.  Because the conditions are only checked by the [[Command:While|While]] statement, you may need to place the loop inside an [[Command:If|If]]. 
  
 
== Examples ==
 
== Examples ==
 +
Declare Count int 1
 +
Do
 +
{
 +
  Echo ${Count}
 +
  VarCalc Count ${Count}+1
 +
}
 +
While "${Count}<10"
  
 
== See Also ==
 
== See Also ==
 +
*[[LavishScript:Break|Break]]
 +
*[[LavishScript:Continue|Continue]]
 +
*[[LavishScript:While|While]]
 
*[[LavishScript:Commands|Commands]]
 
*[[LavishScript:Commands|Commands]]
 
{{Command-Stub}}
 
{{Command-Stub}}

Revision as of 01:40, 24 March 2005

Syntax

Command Difficulty Rating
Do
Usage Beginner
Level of Understanding Intermediate
Computer Savvy Beginner
Logic Intermediate

Do

Description

Used in conjunction with While to create a While loop. The "Do" marks the beginning, whereas "While" marks the end. Because the conditions are only checked by the While statement, you may need to place the loop inside an If.

Examples

Declare Count int 1
Do
{
  Echo ${Count}
  VarCalc Count ${Count}+1
}
While "${Count}<10"

See Also