Specifications
(3) Debug
while
executing
the
program
Conversation
type
debug
is
performed
by
obtaining
information
from
the computer
in the
form
of
error
message.
However, there may
be
occasions when
an
error
message
is
not
displayed yet the calculation
or
program result
is
incorrect. In
cases
like
that
program execution
can
be
carried progressively in steps
to
confirm
the calculation
results along the way. and thereby isolate
the
error.
There are
two
ways
to
do this: (1) the execution process
is
stopped using a STOP
command; (2) execution
is
performed in one Iine units using the TR (trace) mode.
• Debug using a STOP command
Example: Write the
following
program.
10
Y=0
20
INPUT
N,X
30
FOR
1=1
TO N
40
Y=Y+Xt2
50
NEXT
I
60
PRINT
Y
70
END
The value
of
Y.
before
each
consecutive loop.
can
be
viewed using a STOP statement.
Operation:
• The STOP statement should
be
placed
right
after
the calculation
formula.
Write a
STOP statement between line
40
and line 50.
~[1]
45
STOP
GI
• The execution process will stop
after
the calculation
on
line
40
is
completed and
a check
can
be
made then.
~~RUN.
4.
871D
?
?
------_.
__
._----------~-
STQP
• What
is
the value
of
V
at
this point?
YIII
L
Cursor
blinks
17569
-42-
STOP display