EasyManua.ls Logo

Atari XL

Atari XL
262 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...
Advanced
Techniques 197
before
that
most
recently
added.
Try
this
example
program.
10
GOSUB
100
20
PRINT "MAIN
PROGRAM"
30
END
100
GOSUB
200
110
PRINT "SUBROUTINE
100"
120
RETURN
200
GOSUB
300
210
PRINT "SUBROUTINE
200"
220
RETURN
300
RETURN
If
you
run
this
program,
the
XL
will
follow
the
GOSUBs
to
line
300
and
then
RErrURN
progressively
through
each
subroutine,
printing
the
message.
If
you
now
change
line
300
to
read:
300
POP:POP:RETURN
and
run
the
program
again,
the
program
will
only
print
(MAIN PROGRAM'
and
stop.
ERROR
HANDLING
The
XL
has
a
command
which
allows
you
to
take
corrective
action
should
an
error
occur
as
a
program
is
running
-
TRAP.
The
syntax
is:
TRAP N
where
N
is
the
line
number
to
which
the
program
is
directed
when
an
error
is
encountered.
TRAP
must
be
executed
before
the
error
occurs, so you
should
put
it
at
the
start
of
any
program
in
which
you
wish
to
use
it.

Related product manuals