Previous IDL Reference Guide: Procedures and Functions Next

REPEAT...UNTIL

Syntax | Examples | Version History

The REPEAT...UNTIL statement repeats its subject statement(s) until an expression evaluates to true. The condition is checked after the subject statement is executed. Therefore, the subject statement is always executed at least once, even if the expression evaluates to true the first time.


Note
For information on using REPEAT_UNTIL and other IDL program control statements, see Program Control.

Syntax

REPEAT statement UNTIL expression

or

REPEAT BEGIN

   statements

ENDREP UNTIL expression

Examples

This example shows that because the subject of a REPEAT statement is evaluated before the expression, it is always executed at least once:

i = 1  
  
REPEAT BEGIN  
  
   PRINT, i  
  
ENDREP UNTIL (i EQ 1)  

Version History

Original
Introduced

  IDL Online Help (March 06, 2007)