NET/MASTER Network Control Language (NCL) Reference Manual
RETSUB
Core Statements
2–54 106126 Tandem Computers Incorporated
Examples
The following example shows the result of executing a RETSUB statement from a
routine called SUBTASK:
GOGOGO: PROCEDURE
SAY "STARTING A GOSUB"
GOSUB SUBTASK
SAY "&SYS.RETCODE = " &SYS.RETCODE
EXIT
SUBTASK:
SAY "THIS IS THE START OF THE SUBROUTINE"
DO
&A=20
END
RETSUB &A
END GOGOGO
In the preceding example, the effect is to set the &SYS.RETCODE system variable in
the SUBTASK subroutine and then exit from the procedure GOSUB.
The following example returns from the most recently executed GOSUB and sets the
&SYS.RETCODE system variable to 20:
RETSUB 20