Download Print this page

Radio Shack TRS-80 Owner's Manual page 120

Mini-disk operation disk operating system disk basic programming language
Hide thumbs Also See for TRS-80:

Advertisement

r
jwm
,L
J-
RS-80
MODEL
111
DISK
SYSTEM
100
PRINT A*(WD)
110
NEXT
WD
CMD"P"
Check
Printer Status
cmd'
p:
status
status
is
a siring
variable
cmd"P" makes
it
possible
for
Disk basic
to
check
the
status
of
the
printer.
Unlike
the
video
display, the printer
is
not
always
available.
It
may
be
disconnected,
offline,
out of paper,
etc.
In
such
cases,
when
you
try
to
output
information
to
the
printer,
the
Computer
will
wait
until
the printer
becomes
available.
It
will
appear
to
"hang
up."
To
regain
keyboard
control
(and cancel
the printer operation),
press
(BREAK)
.
Suppose you have
a
program which
uses
printer
output.
If a
printer
is
not
available,
you
don't
want
the
Computer
to
stop
and
wait
for
it
to
become
available. Instead,
you
may
want
to
print a
message
such
as
PRINTER
UNAVAILABLE
and
go on
to
some
other operation.
To accomplish
this,
you need
to
check
the printer
status.
cmd"P"
can
be used
to
check
the
printer's status
at
any
time.
It
returns the
contents
as
an Ascii-coded
decimal number.
The
specific
value of
this
number
depends
upon
the
type of
printer
you
are
using
as
well
as
its
status at
any
particular time.
The
value
may
then
be
printed or
examined
by
the
program.
Only
the
four
most
significant
bits
are
used
in
this
"status byte." In binary,
these
must
be:
"0011"
or
else the print
operation
will
not
be
attempted.
To
check
for
this
"go"
condition,
and
the status
byte with
240 and compare
the
result
with
48.
The meaning
of
each
status
bit
depends on which
printer
you
use.
See
the printer
owner's
manual
for
bit
designations.
Sample Program
10
CMD"P"
,){%
20
ST%
=
VAL
<>($}
AND 250
30 IF
SU
<> 38
THEN PRINT "PRINTER UNAVAILABLE": STOP
40
PRINT "PRINTER AVAILABLE"
50
REM PROGRAM MAY NOW CONTINUE
102

Advertisement

loading

This manual is also suitable for:

Model iii