TAL Reference Manual

Statements
TAL Reference Manual526371-001
12-35
Usage Considerations
The variable can be a simple variable, array, read-only array, simple pointer,
structure pointer, structure, or structure data item.
The variable can be of any data type but UNSIGNED.
The variable must be located either:
°
In the lower 32K-word area of the user data segment.
°
In the same 32K-word area of the current code segment as the procedure
that accesses the variable.
The variable cannot have extended indirection.
WHILE
specifies that the scan continues until a character other than test-char occurs or
until a 0 occurs. A scan stopped by a character other than
test-char resets the
hardware carry bit. A scan stopped by a 0 sets the hardware carry bit.
UNTIL
specifies that the scan continues either until test-char occurs or until a 0 occurs. A
scan stopped by
test-char resets the hardware carry bit. A scan stopped by a 0
sets the hardware carry bit.
test-char
is an INT arithmetic expression that evaluates to a maximum of eight significant
bits (one byte). A larger value might cause execution errors.
next-addr
is a 16-bit variable to contain the 16-bit byte address of the character that stopped
the scan, regardless of the data type of
identifier.
Usage Considerations
You should delimit the scan area with zeros. Otherwise, a scan operation might
continue to the 32K-word boundary if either:
A SCAN UNTIL operation does not find a zero or the test character
A SCAN WHILE operation does not find a zero or a character other than the test
character
To delimit the scan area, you can specify zeros as follows:
INT .buffer[-1:10] := [0," John James Jones ",0];
To determine what stopped the scan, test $CARRY in an IF statement immediately
after the SCAN or RSCAN statement. If $CARRY is true after a SCAN UNTIL, the test