While

<< Click to Display Table of Contents >>

Navigation:  Basic concepts > Statements >

While

Syntax: While <BoolExpression> Do <Statements> End

The While statement lets you loop though a block of statements until the Boolean expression evaluates to false. The important difference between a While loop and a For loop is that the former does not have an explicit clause to update the expression to be tested.

Example:

Done = false

While !Done Do

   // Statements, one of which ultimately sets Done to true

End

 
Be very careful with both these looping constructs. If the condition does not ultimately evaluate to false, the loop will never end and Gig Performer will hang.