02.10.2012 Views

Programmer's Reference Manual Intermec Fingerprint® v8.70.0 ...

Programmer's Reference Manual Intermec Fingerprint® v8.70.0 ...

Programmer's Reference Manual Intermec Fingerprint® v8.70.0 ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

RETURN<br />

<strong>Intermec</strong> Fingerprint <strong>v8.70.0</strong>/v10.0.0 Programmer´s <strong>Reference</strong> <strong>Manual</strong><br />

Chapter —Program Instructions<br />

Purpose Statement for returning to the main program after having branched to a<br />

subroutine because of a GOSUB statement.<br />

Syntax RETURN[|]<br />

is optionally the number or label of a line in the main program to<br />

return to.<br />

Remarks When the statement RETURN is encountered during the execution of<br />

a subroutine, the execution will return to the main program. Execution<br />

will continue from the statement immediately following the most recently<br />

executed GOSUB or from an optionally specified line.<br />

If a RETURN statement is encountered without a GOSUB statement<br />

having been previously executed, Error 28, “Return without Gosub” will<br />

occur.<br />

Example 10 PRINT "This is the main program"<br />

20 GOSUB 1000<br />

30 PRINT "You’re back in the main program"<br />

40 END<br />

1000 PRINT "This is subroutine 1"<br />

1010 GOSUB 2000<br />

1020 PRINT "You’re back in subroutine 1"<br />

1030 RETURN<br />

2000 PRINT "This is subroutine 2"<br />

2010 GOSUB 3000<br />

2020 PRINT "You’re back in subroutine 2"<br />

2030 RETURN<br />

3000 PRINT "This is subroutine 3"<br />

3010 PRINT "You’re leaving subroutine 3"<br />

3020 RETURN<br />

RUN<br />

yields:<br />

This is the main program<br />

This is subroutine 1<br />

This is subroutine 2<br />

This is subroutine 3<br />

You’re leaving subroutine 3<br />

You’re back in subroutine 2<br />

You’re back in subroutine 1<br />

You’re back in the main program

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!