pTAL Reference Manual (H06.08+)

Statements
HP pTAL Reference Manual523746-006
12-34
RETURN
RETURN
A RETURN statement causes a procedure or function to return control to its caller.
When you return from a function, the RETURN statement also specifies a value to
return to the functions caller.
cc-expression
is an INT expression whose numeric value specifies the condition code value to
return to the caller:
Specify cc-expression in RETURN statements only in functions and
procedures that specify the attribute RETURNSCC (see Procedure Attributes on
page 14-5).
result-expression
is an arithmetic or conditional expression that a function must return to the caller.
result-expression must be of the same return type as the data type specified
in the function header. The data type of a conditional expression is always INT.
Specify result-expression only when returning from a function.
If result-expression is any type except FIXED or REAL(64), a function can
return both result-expression and cc-expression.
Note.
In the discussion of the RETURN statement, the word procedure implies both procedures
and subprocedures but not functions.
The EpTAL compiler issues a warning whenever a pTAL procedure returns both a
result-expression and a cc-expression and has the procedure attribute
RETURNSCC
on page 14-8. The reason for this warning is in Appendix D, RETURN,
RETURNSCC, and C/C++ on TNS/E.
Value of cc-expression The condition code is set to ...
Less than 0 Less than (<)
Equal to 0 Equal (=)
Greater than 0 Greater than (>)
RETURN
cc-expression
result-expression
cc-expression
,
VST052.vsd