Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see How to Migrate to InterSystems IRIS, available on the WRC Distributions page (login required).

CONTINUE

Jumps to FOR or LOOP statements and re-executes test and loop.

Synopsis

CONTINUE

Arguments

The CONTINUE statement does not have any arguments.

Description

The CONTINUE statement is used within the code block of a FOR...NEXT or LOOP...REPEAT statement. CONTINUE causes execution to immediately jump back to the FOR or LOOP keyword, starting a new iteration of the loop. The FOR or LOOP statement evaluates its test condition, and, based on that evaluation, may re-execute the code block loop.

Example

The following example illustrates the use of the CONTINUE statement:

FOR i=1 TO 10
  PRINT i
  IF i=5 THEN CONTINUE
  ELSE PRINT "not five"
NEXT
PRINT "all done"

See Also

Feedback