Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
Reality V15.0 ()
RTN command (Proc) (m618403+rtn.htm)
Terminates execution of an external Proc subroutine and transfers control to the Proc that called the subroutine via the [ ] statement.
RTN {n}
n specifies that control will be returned to the nth statement after the [ ] command.
The RTN command terminates execution of an external Proc subroutine and transfers control to the Proc that executed the called subroutine via the [ ] command. Execution continues with the statement following the [ ] command.
If the optional n is used, control returns to the n'th statement after the [ ] command. If n is not specified, the default value is 1.
Note: If a Proc called with the [ ] command does not execute a RTN statement, it will not return to the calling Proc, but will terminate.
If a Proc containing a RTN statement is run from TCL, when the RTN statement is encountered it exits to TCL.
.
.
.
IF %1 = ABC RTN
OERROR!
IP?%1
.
.
.
RTN
In this example, if the 1st parameter in the primary input buffer is ABC, then control returns to the calling Proc; otherwise, ERROR is printed and the prompt is redisplayed.