Continue

Continue[]

exits to the nearest enclosing Do, For, or While in a procedural program.

Details

  • Continue[] takes effect as soon as it is evaluated, even if it appears inside other functions.
  • The function of Continue can also be achieved using Throw and Catch.

Examples

open allclose all

Basic Examples  (1)

Scope  (1)

Use Continue inside a Do loop:

Use Continue inside a For loop:

Use Continue inside a While loop:

Properties & Relations  (1)

Break exits the loop:

Introduced in 1988
 (1.0)
 |
Updated in 1996
 (3.0)