TAL Reference Manual

Statements
TAL Reference Manual526371-001
12-34
SCAN Statement
5. If you call a function, rather than invoking it in an expression, you can test the
returned condition code:
INT PROC p1 (i);
INT i;
BEGIN
RETURN i;
END;
INT PROC p2 (i);
INT i;
BEGIN
INT j := i + 1;
RETURN i, j;
END;
CALL p1 (i);
IF < THEN ... ; !Test the condition code
CALL p2 (i);
IF < THEN ... ; !Test the condition code
SCAN Statement
The SCAN or RSCAN statement searches a scan area for a test character from left to
right or from right to left, respectively.
SCAN
indicates a left-to-right search.
RSCAN
indicates a right-to-left search.
variable
is the identifier, with or without an index, of a variable at which to start the scan.
The following restrictions apply:
SCAN
WHILEvariable
RSCAN
UNTIL
test-char
-> next-addr
VST1219.vsd