Printer Control

The LISTPTR command can interrogate the condition of printers and communicate the results to a Proc. The command displays:

  1. The location in the Spooler where the desired printer is available. It is available:

  2. The information that the printer is unavailable.

  3. For example, after executing the LISTPTR command, the following contents are found in the secondary input buffer:

    1134 1171 1 0 4 127 0

    These values can be translated as follows:

    1134

    Buffer contents resulting from LISTPTR command.

    1171

    Printer is inactive.

    1

    Printer number 1.

    0

    First output queue, in this case 0.

    4

    Second output queue, in this case 4.

    127

    Specifies no queue, and is internal flag.

    0

    Page skip specification.

The following Procs shows how to execute the STOPPTR, LISTPTR, and STARTPTR commands under the control of PROC.

PROC

Description

HSTOPPTR 3

Issue a stop command.

P

Execute it.

SS

To the secondary input buffer.

B

Back up input pointer.

5 IF # A G 20

Out of data.

IF A = 1171 G 80

Stopped and inactive, go to start.

IF A = 1174 G 80

Unallocated, go to start.

IF A = 1172 G 15

Pause.

F

To next buffer element.

G 5

Test next.

15 HSLEEP 1

Pause.

20 HLISTPTR 3

Execute the LISTPTR command.

P

Issue the LISTPTR command.

SS

Set the pointer to the secondary input buffer.

B

Back up input buffer pointer.

25 IF A = 1034 G 10

Check for the correct initial mark.

IF # A G 99

Not there.

F

To the next element.

G 25

Test it.

10 F

To the condition.

IF # A G 99

Nothing there.

IF A = 1074 G 80

Not allocated, can be used.

IF A = 1171 G 80

Inactive, go start.

IF A = 1172 G 40

Active.

C THE BUFFER CONTAINS ILLEGAL DATA.

 

XBAD DATA.

Error exit.

40 OTHER PRINTER IS ACTIVE: DO YOU WISH TO WAIT (Y/N)+

 

SP

Set the pointer to the primary input buffer.

IP?

Input the answer.

IF A = Y G 15

Pause.

X TCL

Else exit.

80 HSTARTPTR 3,7,0,S9

Start the printer.

P

Execute the command.

See Also

Using Procs for Printer, Tape and Floppy Disk Control

Hold File Retention

Controlling Tapes and Floppy Disks