EasyManua.ls Logo

Commodore 128D - Program Tracing-The TRON and TROFF Commands

Commodore 128D
427 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...
I
1
n
Program
Tkraclng—The
TRONand
TROFF
Commands
Notice
the
RESUME
in
line
1100.
This
tells
the
computer
to
return
to
the
line
mentioned
(in
this
case,
120)
and
continue.
Depending
on
the
error
that
was
trapped,
resuming
execution
may
or
may
not
be
possible.
For
additional
information
on
error
trapping,
see
the
error
functions
ERRS,
EL
and
ER,
described
in
Chapter
V,
BASIC
7.0
Encyclopedia.
When
a
problem
in
a
program
occurs,
or
you
do
not
get
the
results
you
expect,
it
can
be
useful
to
methodically
work
through
the
program
and
do
exactly
what
the
computer
would
do.
This
pro
cess
is
called
tracing.
Draw
variable
boxes
and
update
the
values
according
to
the
program
statements.
Perform
calculations
and
print
results
following
each
instruction.
Tracing
may
show
you,
for
example,
that
you
have
used
a
GOTO
with
an
incorrect
line
num
ber/or
calculated
a
result
but
never
stored
it
in
a
variable.
Many
program
errors
can
be
located
by
pretending
to
be
the
computer,
and
following
only
one
instruction
at
a
time.
Your
C128
can
perform
a
type
of
trace
using
the
special
com
mands
TRON
and
TROFF
(short
for
TRace
ON
and
TRace
OFF).
When
the
program
is
run,
with
TRACE
ON
the
computer
prints
the
line
num
bers
in
the
order
they
are
executed,
as
well
as
any
results.
In
this
way,
you
may
be
able
to
see
why
your
program
is
not
giving
the
results
you
expected.
Type
any
short
program
we
have
used
so
far,
or
use
one
of
your
own
design.
To
activate
trace
mode,
type
TRON
in
DIRECT
mode.
When
you
run
the
program,
notice
how
line
numbers
appear
in
brackets
before
any
results
are
dis
played.
Try
to
follow
the
line
numbers
and
see
how
many
steps
the
computer
needed
to
arrive
at
a
certain
point.
TRON
will
be
more
interesting
if
you
pick
a
program
with
many
branches,
such
as
GOTO,
GOSUB
and
IF-THEN-line
number.
Type
TROFF
to
turn
trace
mode
off
before
con
tinuing.
85
USING
C128
MODE—Some
BASIC
Commands
and
Keyboard
Operations
Unique
to
C128Mode

Table of Contents

Other manuals for Commodore 128D

Related product manuals