Spooler Programmer's Guide
Sample Print Process
Spooler Programmer’s Guide—522287-002
A-23
 CALL send^status (device);
 END; ! End of control case
 END;
 END; ! End of WHILE 1 loop
 END;
! *===================================================================*
! main procedure
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
! procedure name: SAMPLE^PRINT^PROCESS
! parameters: none
! description: This procedure opens $RECEIVE and reads the Startup
! message. The spooler supervisor process name is
! extracted from the Startup message and opened. The
! spooler process PRINTINIT is called to initialize the
! print control buffer (P^BUF), which will be used in
! other calls to spooler print procedures. Control is
! then passed to the procedure MAIN^LOOP.
!
! If the $RECEIVE open and read fails, if the spooler
! supervisor open fails, or if PRINTINIT returns an error,
! the print process will abnormally terminate. No error
! message indicating abnormal termination is issued.
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PROC sample^print^process MAIN;
 BEGIN
 INT .recv^buf[0:65] := ["$RECEIVE", 62 * [" "]],
 .supv^name[0:11] := 12 * [" "];
!---Beginning of code--------------------------------------------------
 IF openfile (recv^buf, recv^fnum) THEN
 CALL ABEND;
 CALL READ (recv^fnum, recv^buf, 132);
 IF <> THEN
 CALL ABEND;
 CALL CLOSE (RECV^FNUM);
 supv^name ':=' recv^buf[21] for 12;
 IF openfile (supv^name, supv^fnum, 1) THEN
 CALL ABEND;
 IF PRINTINIT (supv^fnum, p^buf) THEN
 CALL ABEND;
 CALL main^loop;
 END;
! *===================================================================*










