Spooler Plus Programmer's Guide

Sample Print Process
Spooler Plus Programmers Guide522293-003
A-5
! that the supervisor file number and print control
! buffer are not required. Instead, this procedure simply
! assumes that these are "supv^fnum" and "p^buf",
! respectively.
!
! Like PRINTSTATUS, some parameters of this procedure are
! either required or optional depending on the message
! type. However, rather than checking for required
! parameters, it is assumed that these parameters have
! been correctly supplied by the print process.
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PROC tell^super (type, device, error, page, line, total^lines,
num^copies) VARIABLE;
INT type, ! required parameter
.device, ! required parameter, name of the device
error, ! required parameter for type 1, 2, 4, and 5
page, ! required parameter for type 0; current
! page number
line, ! required parameter for type 0; current
! line number
total^lines, ! required parameter for type 0; total
! number of lines printed
num^copies; ! required parameter for type 0; number of
! copies of the job remaining to be printed
BEGIN
!---Beginning of code--------------------------------------------------
CASE type OF
BEGIN
!-0- sending status of a job
error := PRINTSTATUS (supv^fnum, p^buf, type, device,
num^copies, page, line, total^lines);
!-1- error occurred on print device, previous operation was unsuccessful
error := PRINTSTATUS (supv^fnum, p^buf, type, device, error);
!-2- end of job
error := PRINTSTATUS (supv^fnum, p^buf, type, device, error);
!-3- unable to open job
error := PRINTSTATUS (supv^fnum, p^buf, type, device, error);
!-4- invalid operation in current state
error := PRINTSTATUS (supv^fnum, p^buf, type, device, error);
!-5- error occurred on print device, previous operation was successful
error := PRINTSTATUS (supv^fnum, p^buf, type, device, error);
END;
IF error THEN
CALL ABEND;
RETURN;
END;