tips:revmedia:r15

Testing Printer Status

Published ByDateVersionKnowledge LevelKeywords
Revelation Technologies11 APR 19891.1XINTERMEDIATEPDISK, PRNSTAT, PRINTERS

When writing programs that will direct output to a printer, it is desirable to know whether or not the printer is ready. Until Version 1.1 of Advanced Revelation, this was a difficult task from within a program. There is now a system subroutine, PRNSTAT, that will return the printer's status.

PRNSTAT takes one argument in which the status of the printer is returned. PRNSTAT can be used as follows:

DECLARE SUBROUTINE PRNSTAT
PRINTER.STATUS = ''
LOOP
  PRNSTAT(PRINTER.STATUS)
  IF PRINTER.STATUS THEN
    * there was a problem
    * error handling goes here
  END
WHILE PRINTER.STATUS REPEAT

PRINTER.STATUS will have one of four values:

StatusMeaning
0Printer ok
1Printer not selected (or not connected)
2Printer out of paper (or not connected)
3I/O or timeout error

Note: In order to implement PRNSTAT, changes to the AREV.EXE were required. PRNSTAT will not work in releases prior to 1.1. Further changes to AREV.EXE are required to make PRNSTAT recognize PDISK. As of Version 1.13, PRNSTAT will always look for a physical printer, even if the output has been redirected to a print file via PDISK.

  • tips/revmedia/r15.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1