EasyManuals Logo
Home>Atari>Desktop>800

Atari 800 Basic Reference Manual

Atari 800
122 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
Page #25 background imageLoading...
Page #25 background image
GOTO
(G.)
To
prevent
accidental
triggering
of
a
subroutine
(which
normally
follows
the
main
program),
place
an
END
statement
preceding
the
subroutine.
The
follow-
ing
program
demonstrates
the
use
of
subroutines.
H3
PRH-H
")"
:::·r_-1
:;,
.·.F~~-~.
E',:-!,H·.
~.
i,F'L
....
t '
~
.-
.
E
,-,r
~-,-
..
-.,
'P
'F.'ET'jr•L'
-'"
- L!.:r - r
·.liJ.::~_
I
u
.··
, : ! f':.ri
30
>=:=100
4~-:-1
co::;tJE:
1
oo~J
5[
1
::<=120
6~1
GOSUE:
1
0(1
~
3
70
>::=50
:::o
Go::;ut:
1
a·.;:Jo
90
Et·~D
1
~1(1~1
'/=3::;::::-::
101[1
;:-:;:
;;
::+\'
(Clear
screen)
Figure
4-3.
GOSUB
/
RETURN
Program
Listing
In
the
above
program,
the
subroutine,
beginning
at
line
1000, is
called
three
times
to
compute
and
print
out
different
values
of
X
andY.
Figure
4-4
illustrates
the
results
of
executing
this
program.
400
301-J
480
360
200
15(1
Figure
4-4.
GOSUB
/
RETURN
Program
Run
Format:
{GO
TO}
ae
xp
GOTO
Examples:
100 GOTO 50
500 GOTO
(X
+
Y)
The
GOTO
command
is
an
unconditional
branch
statement
just
like
the
GOSUB
command.
They
both
immediately
transfer
program
control
to
a
target
lin
e
number
or
arbitrary
express
ion
.
How
ever,
using
anything
other
than
a con-
stant
will
make
renumb
er
ing
the
program
difficult.
If
the
target
line
number
is
non-existent,
an
error
results.
Any
GOTO
statement
that
bran
ches
to
a
preceding
line
may
result
in
an
"e
ndless
"
loop
.
Statements
following
a GOTO
statement
will
not
be
executed.
Not
e
that
a
conditional
branching
statement
(see
IF
/
THEN)can
be
us
ed
to
br
ea
k
out
of
a GOTO
loop
.
The
foll
ow
ing
program
il-
lustr
ates
two
uses
of
th
e GOTO
command.
Program
Stat
eme
nts
17

Table of Contents

Other manuals for Atari 800

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Atari 800 and is the answer not in the manual?

Atari 800 Specifications

General IconGeneral
BrandAtari
Model800
CategoryDesktop
LanguageEnglish

Related product manuals