Skip to main content

Printing - detecting if a printer is on or off

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

How can you detect if a printer is on or off when running a COBOL program on a Windows platform?

Resolution:

This can be done using the WIN$PRINTER routine and specifying the WINPRINT-GET-PRINTER-STATUS op-code.  There is a sample program called prndemox.cbl that demonstrates the use of the WIN$PRINTER routine.

It can be found the Sample sub-directory where ACUCOBOL-GT is installed, e.g.:

C:\\Program Files\\Acucorp\\Acucbl800\\AcuGT\\sample\\prndemox.cbl

It requires 4 copybooks:

acugui.def

winprint.def

fonts.def

crtvars.def

It is also attached to this KB Item.

Attachments:

prndemox.zip

Old KB# 2693

0 replies

Be the first to reply!