while

The while keyword executes a statement block.

Purpose

This statement is used to execute a statement block numerous times.

Syntax

while (test) [{statement1; ... statementn;}] 

Description

The test argument can be any legal test, as in the Java™ programming language. The statement block can execute any ARL statement, arithmetic expressions, and method calls. Empty statement blocks are valid. If you specify only one statement block, the braces {} are not mandatory.

Example

while (a.hasNext()) {
    note("an element : " + a.next());
}