Note: information on this page refers to Ceylon 1.0, not to the current release.

break statement

The break statement is a control directive that causes immediately termination of a 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' break directive is not supported. The break directive operates on the directly enclosing for or while statement.

See also