pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
Example 182 Condition Code Based on Numeric Value
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 183 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 (page 528).
Example 184 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
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, .
EXT32, or .EXT64 indirection symbol.
NOTE: The “Indirection Symbols” (page 41), .EXT32 and .EXT64 are available in the 64-bit
addressing functionality added to the EpTAL compiler starting with SPR T0561H01^AAP. For more
information, see Appendix E, “64-bit Addressing Functionality” (page 531).
SCAN
indicates a left-to-right search.
RSCAN
indicates a right-to-left search.
228 Statements