The If Statement
if statements are used for conditional branching.
if x > y then
The Case Statement
The case statement can test a variable for several different values.
type country is ( australia, u_k, brazil );
Multiple cases can be strung together using a vertical bar (|).
when brazil | u_k => -- brazil or U.K.
The "when" cases must not be variables (although constants are OK). The "when others" case is always required.
The While Loop Statement
The while loop is a pre-test loop. The commands in the loop are repeat while the condition is true and the condition is tested each time the first line of the loop is executed.
while x < y loop
The For Loop Statement
The for loop increments its index variable by 1 until it iterates through the specified range. The index variable is automatically declared for you and only exists for the scope of the the loop. The range can either be numeric or enumerated.
for i in 1..10 loop
To loop in reverse in a for loop, use "in reverse" instead of "in".
The Exit Statement
Any loop can be exited by using either an exit statement or an "exit when" shorthand.
if x > 100 then
exit when x > 100;
The Loop Loop Statement
A "loop" loop is a general purpose loop. It can only be exited with "exit".
|Back To Top|