The next Statement - Maple Programming Help

The next Statement

Description

 • When the next statement is executed, the result is to exit from the current statement sequence (that is, the do-end do block) that corresponds to the innermost repetition (for/while/do) statement within which it occurs.
 • To exit from the current statement sequence means to allow execution to proceed with the next iteration of this repetition statement.
 • Note: To "proceed with the next iteration'' implies to increment the index of iteration, and then to apply the tests for termination (specified by the to-clause and the while-clause, if present) before proceeding.  Thus, an exit from the loop may occur.
 • It is an error if the next statement is executed in a context other than within a repetition statement.
 • In Maple V Release 5.1 and earlier, next was just a Maple symbol. In Maple 6 and later, next is a keyword in the Maple language.

Examples

 > $\mathbf{for}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}n\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{to}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}3\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{if}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}n=2\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{then}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{next}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{end if};\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{print}\left(n\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{end do}$
 ${1}$
 ${3}$ (1)