next up previous contents
Next: Method Calls Up: Statements Previous: Type Case Statements

Loops and the Break Statement

 
  loop ::= ['while' expression ] 'loop' block 'end' .

Example: loop i := 1.upto!(10) ...end tex2html_wrap_inline1707

A loop statement while e loop S end is processed by repeating the evaluation of e and the execution of the block S, the body of the loop, as long as the expression e evaluates to true or until a statement terminating the loop is executed. e must be of type BOOL. loop S end has the same meaning as while true loop S end.

The statement break terminates the innermost loop containing it. It must be syntactically contained within a loop.

A loop body may contain one or more stream calls like until! or upto! which may influence the termination of the loop, cf. 6.7.2.



Martin Trapp
Mon Feb 17 16:49:16 MET 1997