NET/MASTER Network Control Language (NCL) Reference Manual
RETURN
Core Statements
106126 Tandem Computers Incorporated 2–55
RETURN The RETURN core statement returns from a called function or procedure. It can return
from a procedure with the values of optionally specified variables.
If you execute the RETURN statement in a function, you must enclose the expression
in parentheses, as shown in the first example of this core statement. This value
replaces the expression in the statement that called the function. You cannot pass any
additional variables with this form of the RETURN statement.
If you execute the RETURN statement in a procedure, control passes to the statement
in the calling procedure after the CALL statement. The caller receives the values of
any specified shared variables in addition to the currently shared variables.
RETURN { (
expression
) |
variable
[,
variable
… ] }
expression
specifies a value that is returned to the caller and that replaces the function value.
If RETURN is in a function, it must include an expression. To ensure a clear
distinction between the return of a function value and the return of variable(s) in a
procedure, the expression in the former must be enclosed in parentheses.
variable
specifies one or more variables in a list to be returned to the calling procedure.
The list supplements any variables implicitly returned by the current
variable-sharing environment. Each variable in the list must be a simple or stem
variable. No complex, compound, nested, or system variables are permitted. If a
stem is specified, NCL returns the entire compound set of variables for that stem.
Variables types are defined in Section 9, “Variables.”
Considerations
A compilation error results if a RETURN statement in a function does not contain
an expression.
See also FUNCTION and PROCEDURE; these statements use the RETURN core
statement as their exit method.