Download Print this page

Radio Shack TRS-80 model III Owner's Manual page 103

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

Advertisement

TRS-80
MODEL
III
DISK
SYSTEM
100
PRINT A$(WD)
110
NEXT
ND
CMD"P"
Check
Printer Status
mDF\$tatus
status
is
a
string
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
Ascn-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"
#X*
20
SJ1
=
UAL<><$)
AND 240
30
IF
STZ
<> 48
THEN PRINT "PRINTER UNAVAILABLE"
:
STOP
40
PRINT "PRINTER AVAILABLE"
50
REM PROGRAM MAY NOW CONTINUE
102

Advertisement

loading