Programming instructions

Intermec Fingerprint v7.61 Programmers Reference Manual Ed. 7224
Chapter 2 Program Instructions
RETURN
Field of Application
Statement for returning to the main program after having branched to
a subroutine because of a GOSUB statement.
Syntax RETURN[<ncon>|<line label>]
<ncon> is optionally the number or label of a line in the main
program to return to.
Remarks
When the statement RETURN is encountered during the execution of
a subroutine, the execution will return to the main program. Execution
will continue from the statement immediately following the most recently
executed GOSUB or from an optionally speci ed line.
If a RETURN statement is encountered without a GOSUB statement
having been previously executed, Error 28, Return without Gosub
will occur.
Example
10 PRINT "This is the main program"
20 GOSUB 1000
30 PRINT "Youre back in the main program"
40 END
1000 PRINT "This is subroutine 1"
1010 GOSUB 2000
1020 PRINT "Youre back in subroutine 1"
1030 RETURN
2000 PRINT "This is subroutine 2"
2010 GOSUB 3000
2020 PRINT "Youre back in subroutine 2"
2030 RETURN
3000 PRINT "This is subroutine 3"
3010 PRINT "Youre leaving subroutine 3"
3020 RETURN
RUN
yields:
This is the main program
This is subroutine 1
This is subroutine 2
This is subroutine 3
Youre leaving subroutine 3
Youre back in subroutine 2
Youre back in subroutine 1
Youre back in the main program