### While Loops

Another looping mechanism is the While loop. A While loop can be used to execute a fixed block of statement an indefinite amount of time.

#### The 2 different types of While loops

Type of Do Loop | Explanation | Example
--- | --- | ---
While ... Do | The While ... Do loop evaluates the condition, and if the condition is true, then it evaluates the expression following the Do. When it has finished doing this, it evaluates the condition again and if the condition is true, it evaluates the expression following the Do again. It continues repeating this process until the condition is false. |
    While condition Do
       expression
Do ... While | The Do ... While loop evaluates the expression once no matter what. It then evaluates the condition, and if the condition is true, evaluates the expression again. This process continues until the condition is false. |
    Do
       expression
    While condition

Note:

- The While loops support an Exit While statement to immediately jump out of the loop. Its use is analogous to the use of Exit For in For loops.
- As with the For loop, the While loop when considered as an expression always returns the Boolean value True.

Seagate Software, Inc. http://www.seagatesoftware.com Please send comments to: techpubs@seagatesoftware.com