pTAL Reference Manual (H06.03+)

Statements
HP pTAL Reference Manual—523746-005
12-40
SCAN and RSCAN
SCAN and RSCAN
The SCAN and RSCAN statements search a scan area for a test character from left to
right or from right to left, respectively.
The scan variable in an RSCAN or SCAN statement can be a pointer declared with
the.EXT indirection symbol.
SCAN
indicates a left-to-right search.
Example 12-43. Condition Code That Is Independent of the Function’s Value
INT PROC p(i) RETURNSCC;
INT i;
BEGIN
...
RETURN i, f(i); ! Return the value of i and set the
END; ! condition code according to the
! value returned by function f
Note. The EpTAL compiler issues a warning whenever a pTAL procedure returns both a
traditional function value and a condition code value. For details, see Appendix D, RETURN,
RETURNSCC, and C/C++ on TNS/E.
Example 12-44. Invalid Function That Attempts to Return an Explicit Condition
Code
INT PROC p(i);
INT i;
BEGIN
...
RETURN i, f(i); ! ERROR: Cannot specify an explicit
END; ! condition code because procedure
! header does not specify RETURNSCC
RSCAN
SCAN variable
WHILE
UNTIL
test-char
-> next-addr
VST053.vsd