WHILE...DO

Syntax | Examples | Version History | See Also

The WHILE...DO statement performs its subject statement(s) as long as the expression evaluates to true. The subject is never executed if the condition is initially false.

Note
For information on using WHILE...DO and other IDL program control statements, see Program Control (Application Programming).

Syntax

WHILE expression DO statement

or

WHILE expression DO BEGIN

   statements

ENDWHILE

Examples

i = 0 
WHILE (i EQ 1) DO PRINT, i 

Because the expression (which is false in this case) is evaluated before the subject statement is executed, this code yields no output.

Version History

Original

Introduced

See Also

BEGIN...END, BREAK, CASE, CONTINUE, FOR, GOTO, IF...THEN...ELSE, REPEAT...UNTIL, SWITCH, Program Control (Application Programming)