Radio Shack TRS-80 User Manual page 55

Micro computer system
Hide thumbs Also See for TRS-80:
Table of Contents

Advertisement

Chapter 11
Son
of
FOR-NEXT
This
is
heady
stuff. If
you
turned
off the
Computer between
Chapters, load the
program
which you
taped
from
Chapter
10
into
the
Computer.
Modify
the
program
so the
rate
and time
are calculated
and
printed for every
50
mph
incre-
ment
instead
of the
100
mph
increment
presently
in
the
program,
RUN.
Answer:
80
FOR
R
=
200 TO 1000 STEP 50
Trouble
in
the
Old
Corral
What
a revolting
development!
The
printout goes so
fast
we
can't
read
it,
and by
the
time
it
stops, the
top
part
is
cut
off.
Aught
'a
known
you
can't trust these
computers.'
Solutions
For
Sale
Several solutions are
available:
1.
Pressing
nearly
any key
will
stop
program
execution.
Try RLJNning
a
number
of
times,
pressing different
keys (and the space
bar)
during the
run, to see
what
happens.
RUN
again,
this
time
using
only the +
(up-arrow), to
freeze
the
display.
Nifty
huh?
Clean stop
clean
restart.
This
is
the
key
to use for
temporary
freezes.
2. If
you want
a classy display
you
can
build a
"pause"
into
the
program.
The
screen
will
fill,
halt a
moment,
and
automatically go
on
if
you
don't
interrupt the
program.
The
Timing
Loop
In
order
to learn
about
the timer
loop,
let's
employ
another
sly trick.
We're going
to
leave
our
"Flight
time" program
in
the
Computer, and
put
in
a
second program.
As-.
you
can
see,
pressing
a
ksy not
only stops execu-
tion
but
inserts
its
own
letter
of
number.
Messy!
i-
"ii"
There's-
ffppthe* one:
y
ou
em
try
but
it'&not.a
vswry useful
oae
;
press [break;
key. That's
even
jjiessier
than
the
fitst
one.
(To
restart after
a
[break]
,
either
enter
RUN
to
start
program
ail
over again or
C
ON
T
-to
continue execution
*t
..
;-.
ther
"break-point
,f
)
53

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents