NET/MASTER Network Control Language (NCL) Reference Manual
RETURN
Core Statements
2–56 106126 Tandem Computers Incorporated
Examples
The following example is a complete procedure named APROC, which calls another
procedure named PROC1, then passes back the variables &1, &2, and &3. The variable
&1 is displayed and has the value AA as supplied by PROC1:
APROC: PROCEDURE
CALL PROC1 (A, B, C)
SAY "&1 = " &1
EXIT
PROC1: PROCEDURE
&1=AA
RETURN &1, &2, &3
END PROC1
END APROC
The following example shows how a result is returned from a function. The value to
be returned is enclosed within the outermost parentheses:
RETURN ((&B + SQRT(&B ** 2 - 4 * &A * &C)) / (2 * &A))
In the preceding example, the function returns a possible value, in real terms, for x in
the equation ax
2
+ bx + c = 0.