HELP LOOPS                                    J. L. Cunningham July 1982
                                         Revised: Adrian Howard Mar 1992

The usual way to make POP-11 do some instructions several times
(iteration) is to use loops (also called iterative constructs). See:

    *FOR        --- Iteration over lists and structures
    *FOREACH    --- Selective iteration over a database, using pattern
                    matching
    *FOREVERY   --- Like -foreach-, but matches a list of patterns
    *REPEAT     --- Repeats a set of actions a specified number of times
    *WHILE      --- Repeats a set of actions while a condition is -true-
    *UNTIL      --- Repeats a set of actions until a condition is -true-

Loops can be interrupted, conditionally or unconditionally, see:

    *QUITLOOP   --- to jump out of one or more enclosing loops
    *QUITIF     --- to jump out of a loop if a condition becomes -true-
    *QUITUNLESS --- to jump out of a loop if a condition becomes -false-
    *NEXTLOOP   --- to continue an enclosing loop (start next iteration)
    *NEXTIF     --- to restart a loop if a condition becomes -true-
    *NEXTUNLESS --- to restart a loop if a condition becomes -false-

All the above can take an extra integer argument specifying that the Nth
enclosing loop should be terminated or continued. The *RETURN command
terminates the execution of the current procedure, and also jumps out of
any loops.

See HELP *FOR_FORM for information on creating new looping constructs.

For alternatives to the above see:

    *APPLIST    --- Applies a procedure to each element of a list
    *MAPLIST    --- As -applist-, but returning a changed copy of list
    *RECURSION  --- A short introduction to recursion techniques
    *GOTO       --- Transfers control within a procedure (NOT
                    recommended)
    *GO_ON      --- Jump to one of a list of labels
    *SWITCHON   --- A 'case' construct

Also see:

    HELP *CONTROL   --- Information on POP-11 control structures

    REF *FASTPROCS  --- Information on non-checking iteration
                        constructs.
    REF *POPSYNTAX  --- Syntax diagrams for POP-11.
    REF *SYNTAX     --- More on POP-11 syntax


--- C.all/help/loops
--- Copyright University of Sussex 1992. All rights reserved. ----------
