EasyManua.ls Logo

Apple IIe - Page 105

Apple IIe
320 pages
Print Icon
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...
Apple
BASIC
Reference Gui
de
105
Applesoft
GOSUB,
RETURN
Integer
The
GOSUB, RETURN
statements are used
to
branch
to
a
subroutine
and
then
return
from
it.
)
f"
Con
1gurat1on
GOSUB
li
ne
RETURN
line
is
the
first
line
of
a
subrout
i
ne
.
In
Applesoft
,
the
GOSUB
will
branch
to
line
0
if
line
is
omitted
or
an expression is used.
In
Integer
BASIC,
line
can
be
an expression,
where
the
expression
evaluates
to
a
line
number
of
a
subroutine.
A
subrout
i
ne
is
called
by
the
GOSUB
statement.
When
the
RETURN
statement
is
encountered
within
that
subroutine
,
program
control
will
branch
back
to
the
statement
following
tbe
GOSUB
statement
just
executed
.
Subroutines
may
appear
at
any
point
within
the
program.
However,
it
is
good
programm
i
ng
practice
to
group
all
sub-
routines
near
the
beginning
of
the
program.
Example
10
GOTO
60
20
PRINT
X,
30 Y
=
X*X
40
PRINTY
50
RETURN
60
X
= O
70
FOR I = 1
TO
3
80 X
=
X+1
90
GOSUB
20
pr
og
r
am
continued
on next page (

Other manuals for Apple IIe

Related product manuals