TRS-SO
MODEL III
To
prevent this from happening, make sure
BASIC's
maximum line length (stored in
address
16427)
is no greaterthan that
of
yourprinter. You can find your printer's
maximumline length in the printer
owner's
manual.
To
do an automatic top
of
form (advancing the paper to the top
of
the next page),
printthe ASCII'
'Form
Feed" code, decimal
12.
Forexample, execute the
BASIC
statement:
LPRINTCHR$(12)
Thepaperwill advance by the following amount:
Top
of
Form = Max.
lines/page-Lines
already printed
Each time you print a form feed, CHR$(l2),
BASIC
resets the line count
automatically.
Sometimes you may want to reset the line count, for example, after manually
advancing the paperto the top
of
form.
To
do this, store a one in
16425:
POKE 16425, 1
Checkingthe
Printer
Status
Unlike the Video Display, the printer is not always available.
It
may be
disconnected, off-line, out-of-paper, and so forth. In such cases, when you try
printeroutput, the Computerwill wait until the printer becomes available.
It
will
appear to
be'
'locked
up"
.
To
regain keyboard control (and cancel the printer
operation), press
(BREAK),
Suppose you have a program which uses printeroutput.
If
a printeris not available,
you
don't
want the Computerto stopand wait for it to become available. Instead,
you may want to print a message like
"PRINTER
UNA
V
AILABLE"
and stop.
To
accomplish this, you need to check the printer status. The status is stored in
address
14312.
AND
this value with
240.
The result should equal
48.
If
it
doesn't,
that
means the Printeris unavailablefor some reason, and printeroutput is not possible.
Forexample, yourprogramcouldexecute these statements:
100
ST%
= PEEK(14312)
AND
240
120
IF
ST%
< >
48
THEN
PRINT
"PRINTER UNAVAILABLE.":
STOP
130
PRINT
"PRINTER
IS
AVAILABLE"
7/4