Note: information on this page refers to Ceylon 1.2, not to the current release.
break statement
The break statement is a control directive that causes immediate
termination of the enclosing for or while loop.
Usage
The general form of the break statement is
// ...within a while or for statement
// and often guarded by some condition
break;
Description
Execution
Within a for or while statement the break directive can be used to exit
the block early without waiting for the for iterator to be exhausted or the
while condition to become false.
Notes
- Java's 'labelled'
breakdirective is not supported. Thebreakdirective operates on the directly enclosingfororwhilestatement.
See also
- The
continuestatement - The
forstatement - The
whilestatement - Control directives in the Ceylon language specification