condition - Maple Help

condition

run through a procedure again if a condition is not met

 Calling Sequence proc()  statements;  condition: x;  end;

Parameters

 x - a boolean expression

Description

 • During execution of a procedure, if a condition statement is reached and the defined condition, x is not met, then execution of the entire procedure is restarted.
 • A condition statement can be added as a top-level line inside any procedure.  By "top-level" we mean that it cannot occur inside of any compound statement like a loop or if statement.

Examples

 > p := proc() local a := rand(-1..1)(); condition: a <> 0; a; end:
 > $\left\{\mathrm{seq}\left(p\left(\right),i=1..20\right)\right\}$
 $\left\{{-1}{,}{1}\right\}$ (1)

Compatibility

 • The condition command was introduced in Maple 18.