Spooler Plus Programmer's Guide

Sample Perusal Process
Spooler Plus Programmers Guide522293-003
B-10
line[0] := " ";
line[1] ':=' line[0] FOR 79;
line[2] ':=' "JOB";
line[8] ':=' "OWNER";
line[17] ':=' "PAGES";
line[24] ':=' "WAIT";
line[35] ':=' "FORM";
CALL WRITE (termnum, iline, 0);
CALL WRITE (termnum, iline, 80);
! Get and display the status of the jobs waiting to print on the
! device
job^status.device^name ':=' device FOR 16;
job^status.sequence^number := 0;
error^code := SPOOLERSTATUS(supernum, 7, 1, job^status);
WHILE error^code = 0 DO
BEGIN
line[0] := " ";
line[1] ':=' line[0] FOR 79;
CALL NUMOUT(line[2], job^status.job^number,10, 4);
temp := job^status.owner^id.<0:7>;
CALL NUMOUT(line[8], temp, 10, 3);
temp := job^status.owner^id.<8:15>;
line[11] := ",";
CALL NUMOUT(line[12], temp, 10, 3);
CALL NUMOUT(line[17], job^status.pages,10, 4);
line^total := line^total +
(job^status.total^lines/dev^stat.speed);
CALL NUMOUT(line[24], line^total, 10, 6);
line[35] ':=' job^status.form^name FOR 16;
CALL WRITE( termnum, iline, 60);
error^code := SPOOLERSTATUS(supernum, 7, 1, job^status);
END;
IF error^code <> %14006 THEN CALL err(error^code);
END;
END;
?page
! devall displays the status of all devices in the system.
PROC devall;
BEGIN
INT error^code,
i, j, temp,
line^total := 0;
! Prepare the header line of the display
line[0] := " ";
line[1] ':=' line[0] FOR 79;
line[0] ':=' "DEVICE";
line[36] ':=' "STATE";
line[51] ':=' "FLAGS";
line[58] ':=' "PROC";
line[66] ':=' "FORM";
CALL WRITE (termnum, iline, 80);
dev^stat.name ':=' [ 16 * [" "] ];
! Get and display the status of all devices in the spooler
error^code := SPOOLERSTATUS(supernum, 1, 1, dev^stat);
WHILE error^code = 0 DO
BEGIN
line[0] := " ";
line[1] ':=' line[0] FOR 79;
j := 0;
FOR i := 0 to 16 DO
BEGIN
IF dev^stat.name[i].<0:7> <> " " THEN
BEGIN
IF j <> 0 AND (i = 4 OR i = 8 OR i = 12) THEN