The break Statement - Maple Programming Help

The break Statement

Description

 • When the break statement is executed, the result is to exit from the innermost repetition (for/while/do) statement within which it occurs.
 • After exit, execution proceeds, with the first statement following the repetition statement.
 • It is an error if a break is executed in a context other than within a repetition statement.
 • In Maple V Release 5.1 and earlier, break was just a Maple symbol. In Maple 6 and later, break is a keyword in the Maple language.

Examples

 > $L≔\left[1,2,"abc","a",7.0,\mathrm{\infty }\right]:$
 > $\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{in}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}L\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{if}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{type}\left(x,'\mathrm{string}'\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{then}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{print}\left(x\right);\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{break}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{if}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}$
 ${"abc"}$ (1)