Do Loop Statement

The Do Loop statement is a control structure that repeats a series of code lines as long as an expression is TRUE. It does not return a value.

If an Exit Do statement runs, then control flows to the statement that resides immediately after the Loop statement. If you use an Exit Do statement in a nested loop, then it moves control out of the immediate loop.

Format A

Do [{ While|Until } condition]
statement_block
   [Exit Do]
   statement_block
Loop
Do
statement_block
   [Exit Do]
   statement_block
Loop [{ While|Until } condition]

The following table describes the arguments that you can use with this method.

Argument Description

condition

Any expression that evaluates to TRUE (not zero) or FALSE (0).

statement_block

Code lines to repeat while or until the value you specify in the condition argument is TRUE (not zero).

Example

For examples, see Get File Names Method, Erase Array Method, and Get Error Code Method.