RSUB

Terminates execution of a local subroutine and returns control to the statement following the GOSUB command that called the subroutine.

Syntax

RSUB {n}

Syntax Elements

n specifies return control to the nth statement after the GOSUB.

If n is not specified, the default value is 1.

Operation

The RSUB command terminates execution of a local subroutine and returns control to the statement following the GOSUB that originally called the subroutine.

If an RSUB is executed without having been called by a previous GOSUB, it is ignored and execution continues with the next statement.

Examples

GOSUB 400
OENTER ACCOUNT NUMBER+
.
.
.
400 O***ILLEGAL ENTRY***
RI
IP?
RSUB

In this example, RSUB returns control to the statement following the GOSUB, that is, OENTER ACCOUNT NUMBER+.

GOSUB 22
OFIRST
OSECOND
OTHIRD
.
.
.
22 C*LOCAL SUBROUTINE ENTERED
RI
RSUB 2

This example returns control to the 2nd statement following the GOSUB, that is, to OSECOND.