Tandy 1000 Basic Reference Manual page 296

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter
10
I BASIC Keywords
RETURN
Statement
RETURN
[Line]
Returns control to the line immediately following the most re-
cently executed GOSUB.
Line
tells BASIC to return to a specific line in the program. If
you omit
line,
BASIC goes to the line immediately following the
GOSUB.
Use caution when specifying a line number with RETURN. Any
other GOSUB, WHILE, or FOR statement remains active while
a GOSUB subroutine is executing. If BASIC returns to a line
number that is outside these loops, a n error occurs because the
loops were left incomplete.
If the program encounters
a RETURN statement without execu-
tion of a matching GOSUB, a n error occurs.
Example
RETURN 4 0
returns from the subroutine to Line 40 in the program.
Sample Program
3 3 0 P R I N T " T H I S
PROGRAM F I N D S THE AREA OF
A
C I R C L E "
3 4 0 I N P U T " T Y P E
I N
FI
V A L U E FOR THE R A D I U S " ;
R
3 5 0 GOSUB 3 7 0
3 6 0 P R I N T "AREA
I S "
;
A :
END
3 7 0
A
=
3 . 1 4
R
*
R
3 8 0 RETURN
294

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents