Sharp OZ-707 Operation Manual - Page 76
s,lalles, start~d
![]() |
UPC - 074000012141
View all Sharp OZ-707 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 76 highlights
GOSUB ... RETURN FORMAT: GOSUB {line number} *Iabel RE+URN {line number} *Iabel Abbreviation: GOS. RE. See Also: GOTO, ON...GOSUB PURPOSE: Diverts program execution to a BASIC subroutine. REMARKS: When you wish to execute the same group of statements several times in the course of a program, it is convenient to use the BASIC capability for subroutines using GOSUB and RETURN . The group of statements is included in the program at some location where they are not reached in the normal sequence of execution. A common location is following the END statement that marks the end of the main program. At each location in the main body of the program where a subroutine is to be executed, include a GOSUB statement with a line number or *Iabel that indicates the starting line number of the subroutine. The last line of each subroutine must be a RETURN . When GOSUB is executed, the Card transfers control to the indicated line number or *Iabel and processes the statements until a RETURN is reached . Control is then transferred back to the statement following the GOSUB. If a line number or *Iabel follows RETURN, control will return to the line number or *Iabel. Subroutines may be "nested" up to 36 levels deep. (See Appendix E.) Since there is an ON ...GOSUB structure for choosing different subroutines at given locations in the program, the expression in a GOSUB statement usually consists of just the desired line number or *Iabel. 140 p GOTO o FORMAT: GOTO {line number} lI
![](/manual_guide/products/sharp-oz707-operation-manual-7aa0508/76.png)