Sharp MZ-700 Series Owner's Manual page 51

Personal computer
Hide thumbs Also See for MZ-700 Series:
Table of Contents

Advertisement

Since execution of the program shown above will continue indefinitely, stop it
by pressing the | SHIFT ] and
BREAK] keys together (this may be done at any
time to stop execution of a BASIC program). To resume execution, execute the
CONT J command.
Note
The line number specified in a GOTO statement may not be that of a line included
within a FOR . . . NEXT loop.
2. 3. 6. 3 GOSUB ~ RETURN .
GOSUB Ln
(abbreviated format: GOS. ~ RET.)
Format
Function
RETURN
Ln . . . Destination line number
The GOSUB statement unconditionally transfers program execution to a BASIC
subroutine beginning at the line number specified in Ln; after execution of the
subroutine has been completed, execution is returned to the statement following
GOSUB when a RETURN statement is executed.
GOSUB ~ RETURN statements are frequently used when the same processing is
required at several different points in a program. In such cases, a subroutine which
performs this processing is included at some point in the program, and execution
is branched to this subroutine at appropriate points by means of the GOSUB state-
ment. After the required processing has been completed, execution is returned to
the main routine by the RETURN statement.
49

Advertisement

Table of Contents
loading

Table of Contents