Return

From BR Wiki
Jump to navigation Jump to search

The Return (RETU) statement works in conjunction with the GoSub statement. After execution of a subroutine, RETURN transfers control back to the statement immediately following the most recently executed GOSUB.

Comments and Examples

RETURN is required at the end of every subroutine. In the following example, the subroutine in line 5000 is repeated several times throughout the program. Each time the subroutine finishes executing, RETURN transfers control back to the first executable statement after the calling GOSUB.

00100 GOSUB 5000
o
o
o
05000 PRINT "This is my subroutine"
05010 RETURN

Syntax

RETURN