condition - Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : condition

condition

run through a procedure again if a condition is not met

 

Calling Sequence

Parameters

Description

Examples

Compatibility

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:

seqp&comma;i=1..20

−1&comma;1

(1)

Compatibility

• 

The condition command was introduced in Maple 18.

• 

For more information on Maple 18 changes, see Updates in Maple 18.