Search                        Top                                  Index
HELP TILL                                               A. Sloman, April 1985

This is used in one form of the FOR statement, viz:

    for <action1> step <action2> till <condition> do <actions> endfor;

This first causes the instructions <action1> to be executed. Next <condition>
is checked to make sure it is not yet true (if it is, nothing more will
happen). After that the <actions> are repeatedly executed, each execution
being followed by the execution of the instructions <actions2> and the
checking of the condition. This continues until the condition evaluates to
TRUE, when the execution of the FOR loop is terminated. Thus:

    for "fred" -> person step father(person) -> person
       till person = "adam"
        person =>

would print out:

    ** fred
    ** frank
    ** tom
    ** cain

    *FOR   - forms and uses of FOR loops in iteration over lists and integers
    *LOOPS - for other types of iteration