CONTINUE statement

Interrupts the execution of a WHILE loop and forces a reevaluation of the WHILE condition. Only valid inside the DO clause of a While Statement.

Syntax

CONTINUE;

Usage

The Continue statement interrupts the execution of a WHILE loop and re-evaluates the WHILE condition. If the condition is still true, the next execution of the loop begins. If the condition is false, then the While statement is exited and the next statement in the function outside of the loop is executed.

Example

CREATE FUNCTION BreakContinueDemo( 
   Value Integer, SkipMultiples Integer, StopValue Integer ) 
RETURNS INTEGER 
BEGIN  
   CREATE VARIABLE INTEGER Result = 0;  
   WHILE 0 < Value DO   
      IF VALUE = StopValue THEN   
          BREAK;   
      END IF;   
      IF SkipMultiples != 0 
        and VALUE mod SkipMultiples = 0 THEN   
         Value  = Value - 1;   
         CONTINUE;   
      END IF;   
      Result = Result + Value;   
      Value  = Value - 1;  
   END WHILE;  
   RETURN Result; 
END FUNCTION;