EasyManua.ls Logo

Texas Instruments TI-99/4A

Texas Instruments TI-99/4A
204 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
RETURN
RETURN
The
RETURN
sta.tement
i",
used
with
the
GOSUB
statement
to provide a branch and return structure for
TI
BASIC.
Whenever the computer encounters a
RETURN
statement, it
takes
the
program
back
to
the
program
line
immediately
following
the
GOSUB
statement that transferred the computer to
that
particular
subroutine in the first place.
You
can
easily develop programs with
subroutines
which
jump
to
other
subroutines
and
back
again,
if
you
are careful
that
each GOSUB leads the computer
to
a
RETURN
statement.
If,
when
running
a
program.
the
computer
encounters
a
RETURN
statement before performing a
GOSUB
instruction. the program
will terminate with the message "CAN'T DO THAT."
1I-116
Examples:
>NEW
>100
FOR
1=1
TO
3
>110
GOSUB
150
>120
PRINT
"1=";1
>130
NEXT
1
>140
STOP
>150
ReM
SUBROUT1NE
>160
FOR
X=1
TO
2
>170
PRINT
"X=";X
>180
NEXT
X
>190
RETURN
>RUN
X= 1
X=
2
I
~
1
X=
1
X=
2
r=
2
x",
1
X~
2
1= 3
**
DONE
**
User's
Reference
Guide

Other manuals for Texas Instruments TI-99/4A

Related product manuals