The Freya Programming Language

Loop statements

See also

The loop statement executes its statement list for ever. You must include Break or Exit procedure calls for terminating iteration.

Syntax

The loop statement syntax allows to include a list of semicolon separated statements without grouping them inside a block:

loop
    statement-list...
end;

By default, this is an never ending loop. You must use one from these special statements in order to alter the default control flow:

StatementPurpose
BreakInterrupts the loop and resumes execution immediately after the loop's end.
ContinueSkip remaining statements and jumps to the beginning of loop.
ExitInterrupts the loop and exits the current method.
goto labelJumps to an arbitrary point inside the method.

See also

The Freya Programming Language
Statements
goto statements
repeat statements
while statements
for statements