line
GOSUB
The
GOSUB
statement branches program control to specified line and
allows a return to the next statement following the
GOSUB
calI.
Format:
GOSUB
line
where:
is
a numeric constant specifying the first line of
the subroutine.
No special entry to a subroutine
is
needed. The program branches control ta
the subroutine after making an entry on the Stack
(see
Chapter
6).
The subroutine
must terminate
with
a
RETURN
statement to return program control ta the state-
ment
following
the
GOSUB
statement
that
activated the subroutine. The
RETURN
removes the Stack entry. A subroutine may
be
called from many places in a pro-
gram. As many
as
26 subroutines may
be
nested
(25
GOSUBs before the first
RETURN).
Example:
10
GOSUB
100
GOTO
The
GOTO
statement branches unconditionally to the specified line.
Format:
GO
TO}
.
GOTO
Ilne
where:
line
Example:
10
GOTO
100
is
a numeric constant specifying the line to be
branched
to.
GOTO
executed in immediate mode branches to the specified line in the
stored program
without
clearing the current variable values.
GOTO
cannot
reference immediate mode statements, since they
do
not have line numbers.
IF
.
..
THEN
The
IF
...
THEN
statement provides conditional execution of statements
based
on
a relational expression.
131