IB Statements/continue

From CometWiki

< IB Statements
Revision as of 11:42, 20 May 2009 by Badge (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

CONTINUE statement

Syntax: CONTINUE

Discussion: The CONTINUE statement passes control to the NEXT statement in a FOR/NEXT structure or to the LOOP statement in a DO/LOOP structure.

A CONTINUE statement must occur within a FOR/NEXT structure or a DO/LOOP structure.

If a CONTINUE statement occurs within an IF/THEN or IF/THEN/ELSE structure, the IF structure must itself be within a FOR/NEXT loop or DO/LOOP structure, and the CONTINUE statement refers to the FOR or DO structure, accordingly.

There can be multiple CONTINUE statements within a given FOR/NEXT or DO/LOOP structure.

Example:

  DO WHILE A LT 100      ! Start the loop
  .
  IF A=B              ! If A = B, then
       CONTINUE       ! jump to the LOOP statement
  ELSE                ! otherwise
  .                   ! execute these statements
  .
  ENDIF               ! End the IF structure
  .
 LOOP                   ! End the DO structure
Personal tools