While

While allows you to repeat a loop of instructions as long as a condition is true.

Syntax

While EXPRESSIONINSTRUCTION_LISTWend

Examples

# Example 1 : let's perform a computation with successive approximationsVARIA=INIT_VALUEWhile abs(func COMPUTE(VARIA)-TARGET)>EXPECTED_PRECISIONVARIA=func ITERATE(VARIA)Wend# Example 2 : let's wait until the database is updated or until a limit hour is reachedTIMEOUT="22:00:00"While time$<TIMEOUTSleep 1Break func DATABASE_UPDATED=1Wend

Description

While allows to perform loops as long as the following occurs:

If the condition is false at the beginning, no iteration is done, and the execution resumes after the Wend.

Associated errors

Error codeDescription
10The expression given after Until is not numeric.

See also

For, To, Next, Step, Break, Repeat, Until, Wend, If, Then, Else, Elsif, Endif.