Stop, Check And Continue - Sharp MZ-80A Owner's Manual

Hide thumbs Also See for MZ-80A:
Table of Contents

Advertisement

53
Stop, Check and Continue
The
computer
does
not
always work as
desired when operated
with a
program
generated. This requires
a
STOP
statement
to
be inserted
to
check the
contents
of variables
at
the
stop
position. For example, in the following
program,
the
STOP
statement
is
inserted.
10 READ
A,
B
20
X = A
*
B
30 STOP
-
40 Y =
A/B
50 END
60
PRINT
X.Y
70 DATA
15.
5
80
END
RUN
Stop in 30
<
At
the
time,
the display of variables is made in direct
mode
as
follows:
PRINT A.B, X TR
This enables you
to
check the program. To
re-start
the
program, give
a
command
to
the
computer as
follows:
CONT CR
The
computer restarts execution
from the
stop
position.
With the END
statement
at
line number 50, the
computer
displays the "Ready" and
stops
again. Then, print
in the direct mode,
as
follows:
X = 3 : Y
=
5
|CR~j
The
computer
will then continue program execution when the CONT command
is given,
displaying 3 and 5 for
variables X and
Y.
The following
program
continues
to
display
a triangle
of
marks,
indefinitely.
10 A = 0:B =
38:C=1
20 FOR X
=
ATOB STEP
C
30 FOR Y
=
0 TO X
40
PRINT
"
*
"
;
50
NEXT Y
:
PRINT
:
NEXT X
60 K
=
A:A=B:B
=
K
70 C
=
— C : GOTO 20
With the BREAK
key
pressed
while holding down the SHIFT key, program execution
stops.
Then, insert the
following in the
program
and
give
the CONT command.
100 END
This is
followed by the
display
below.
Error 17
....
.......................
CONT command
cannot
be executed.
The
CONT command
cannot
be used when
a
program is
edited
using a
line
number
after program
execution
has
been stopped with the STOP
statement,
END
statement
or
BREAK
key operation.
This
requires special attention.
The CONT command
is used
when ;
Program
execution is stopped with the
SHIFT
-
BREAK keys.
Program
execution is
stopped by
the
STOP
or
END
statement.
Inputs are
stopped
at
the
INPUT
statement
using the SHIFT
-
BREAK keys.
The CONT command
cannot
be used
;
Before
program has
been executed
using the
RUN
command.
When program is edited after execution
has
been stopped.
If
an error occurs during execution. Program
returns
to
the "Ready".
To
stop
cassette
tape
operation,
cassette
tape
operation is stopped with the SHIFT
+
j
B REAK
i
keys.
When the
MUSIC command for
music
sound
is
stopped.

Advertisement

Table of Contents
loading

Table of Contents