Continue

Continue[]

goes to the next iteration of the nearest enclosing Do, For, Until 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)

Use Continue to only sum numbers between 1 and 10:

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:

Wolfram Research (1988), Continue, Wolfram Language function, https://reference.wolfram.com/language/ref/Continue.html (updated 2022).

Text

Wolfram Research (1988), Continue, Wolfram Language function, https://reference.wolfram.com/language/ref/Continue.html (updated 2022).

CMS

Wolfram Language. 1988. "Continue." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/Continue.html.

APA

Wolfram Language. (1988). Continue. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Continue.html

BibTeX

@misc{reference.wolfram_2023_continue, author="Wolfram Research", title="{Continue}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/Continue.html}", note=[Accessed: 18-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_continue, organization={Wolfram Research}, title={Continue}, year={2022}, url={https://reference.wolfram.com/language/ref/Continue.html}, note=[Accessed: 18-March-2024 ]}