Search Top Index
HELP WHILE Steven Hardy, January 1978 The syntax word WHILE provides one way of building a loop in POP-11. The statement while <condition> do <actions> endwhile evaluates the condition and if it is true executes the <actions>, then goes back to test the condition again. This iteration continues until the condition is false, for example 10 -> n; while n > 0 do ppr(n) n - 1 -> n endwhile; will print out: 10 9 8 7 6 5 4 3 2 1 The iteration can be terminated using any of * RETURN, * QUITLOOP, *QUITIF, * QUITUNLESS or re-started using * NEXTLOOP, * NEXTIF, * NEXTUNLESS See HELP *UNTIL - like WHILE but repeats a set of actions UNTIL a condition is true *FOR - iteration over numbers or structures *LOOPS - for other types of iteration *CONTROL - for an overview of control facilities See also REF * SYNTAX, REF * POPSYNTAX --- C.all/help/while --------------------------------------------------- --- Copyright University of Sussex 1987. All rights reserved. ----------