Spooler Programmer's Guide
Sample Print Process
Spooler Programmer’s Guide—522287-002
A-22
BEGIN
IF error THEN
BEGIN
suspend := 1;
suspended := 1;
msg^type := IF successful^op THEN
dev^error^5
ELSE
dev^error^1;
call tell^super (msg^type, device, device^file^error +
error);
successful^op := 0;
END
ELSE
BEGIN
successful^op := 1;
IF busy^flag AND NOT suspended THEN
CALL read^and^print (next^line, device);
IF end^of^job^flag THEN
CALL stop^job (device, error);
END;
END;
IF fnum = supv^fnum THEN
BEGIN
IF PRINTCOMPLETE (supv^fnum, p^buf) THEN
CALL ABEND;
IF PRINTREADCOMMAND (p^buf,
control,
device,
dev^flags,
dev^param,
dev^width,
skip^num,
data^file^name,
job^num,
location,
formname,
reportname,
page^size) THEN
CALL ABEND;
CASE control OF
BEGIN
! control = 0: OPEN DEVICE
CALL open^dev (device);
! control = 1: CLOSE DEVICE
CALL close^dev (device);
! control = 2: START JOB
CALL start^job (device, data^file^name, job^num,
location, formname, reportname,
dev^flags, dev^param, dev^width,
page^size);
! control = 3: STOP JOB
BEGIN
CALL req^stop^job (device);
END;
! control = 4: RESUME JOB
CALL resume^job (device);
! control = 5: SUSPEND JOB
CALL suspend^job (DEVICE);
! control = 6: FORM ALIGNMENT
CALL align^form (DEVICE);
! control = 7: SKIP TO PAGE
CALL skip^to^page (skip^num, device);
! control = 8: SKIP PAGES
CALL skip^page (skip^num, device);
! control = 9: SEND STATUS