pTAL Conversion Guide

Statements
pTAL Conversion Guide527302-002
15-23
SCAN and RSCAN Statements
SCAN and RSCAN Statements
SCAN and RSCAN statements behave in pTAL as they do in TAL; however, you must
consider:
How SCAN and RSCAN statements are affected by the location of your data
The data type of variables that point to data in P-relative arrays
Topics:
Extended Pointers on page 15-24
Scanning Across Variable Boundaries on page 15-24
Scanning Data in P-Relative Arrays on page 15-25
Example 15-32. Function Returns Condition Code Based on Its Rturn Value
(pTAL)
INT PROC p(i);
INT i;
BEGIN
...
RETURN i; ! Return i and set the condition code
END; ! based on the numeric value of i
Example 15-33. Function Returns Condition Code Not Based on Its Return Value
(pTAL)
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
Example 15-34. Invalid pTAL Function
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