Scan Part Combinations

The formal syntax of the <scan part> can be reduced to the following combinations:

WHILE <relational operator> <arithmetic expression>
UNTIL <relational operator> <arithmetic expression>
WHILE IN <truth set table>
UNTIL IN <truth set table>
FOR <count part> WHILE <relational operator> <arithmetic expression>
FOR <count part> UNTIL <relational operator> <arithmetic expression>
FOR <count part> WHILE IN <truth set table>
FOR <count part> UNTIL IN <truth set table>

Each of these combinations is discussed in the following separate sections. Because all combinations of the SCAN statement begin with <source>, each description of a combination begins with the assumption that the stack-source-pointer has been initialized to the source pointer.

The scan parts that contain a count part examine, or scan, source characters until either the number of characters specified by the arithmetic expression in the count part have been examined or a source character fails or passes the test specified by the condition syntax. The scan parts that do not contain a count part examine source characters until either a source character fails or passes the test specified by the condition syntax or the end of the array is reached. If the end of the array is reached, the program is discontinued with a paged (segmented) array error.