|
LoopsYorick has three types of loops: while (condition) body_statement
The init_expr and inc_expr of a for loop may be comma delimited lists of expressions. They or the test_expr may be omitted. In particular, for (;;) ... means ``do forever''. If there is a test_expr, the body_statement of the for loop will execute until it becomes false (possibly never executing). After each pass, but before the test_expr, the inc_expr executes. A for loop to make N passes through its body_statement might look like this: for (i=1 ; i<=N ; i++) body_statement Within a loop body, the following statements are legal: break exit the current loop now
For more complex flow control, Yorick supports a goto:
|