ITERATE statement

Purpose

Start an immediate iteration of a loop structure.

Syntax

ITERATE [DO | LOOP | FOR]

Remarks

ITERATE is just like using a GOTO to the line immediately before the NEXT statement (of a FOR...NEXT loop), the LOOP statement (of a DO...LOOP loop), or the WEND statement (of a WHILE..WEND loop).  For example, the following code fragments are equivalent:

FOR ix = 1 TO 100

  ...

  ITERATE FOR

  ...

NEXT

 

FOR ix = 1 TO 100

  ...

  GOTO iterateForLoop

  ...

iterateForLoop:

NEXT

If you do not specify DO, LOOP, or FOR, ITERATE will iterate the most recently executed structure.  For example:

FOR ix = 1 TO 10

  DO UNTIL x > 10

    ...

    ITERATE  ' will iterate the DO LOOP

    ...

  LOOP

NEXT

ITERATE DO and ITERATE LOOP are interchangeable.

Use this statement...

To iterate this kind of loop

ITERATE FOR

FOR/NEXT

ITERATE DO, ITERATE LOOP

DO/LOOP, WHILE/WEND

See also

DO/LOOP, EXIT, FOR/NEXT, WHILE/WEND