Spooler Plus Programmer's Guide
Sample Perusal Process
Spooler Plus Programmer’s Guide—522293-003
B-14
BEGIN
WHILE ((page + number) > current^page)
AND (error^code = 0) DO
BEGIN
CALL WRITE(termnum, dline, 80);
error^code := STRIPLINES(jobbuff, dline, 900, 0);
IF error^code <> 0 AND error^code <> %14002 THEN
BEGIN
! Error handling
CALL err(error^code);
END;
error^code := PRINTINFO(jobbuff, , current^page);
IF error^code <> 0 AND error^code <> %14002 THEN
BEGIN
! Error handling
CALL err(error^code);
END
END;
END;
END;
END
ELSE ! request for lines not pages
BEGIN
FOR i := 1 to lines DO
BEGIN
error^code := STRIPLINES(jobbuff, dline, 900, page);
IF error^code <> 0 THEN
BEGIN
! Error handling
CALL err(error^code);
END
ELSE CALL WRITE(termnum, dline, 80);
END;
END;
END; ! LIST
?page
! INIT initializes global values and opens the terminal and supervisor.
! It also opens $RECEIVE and reads the Startup message.
! Current^job is set to the job most recently opened.
PROC INIT;
BEGIN
INT timestamp[0:2] := 3*[0],
error^code := 0,
i;
userid := CREATORACCESSID;
CALL OPEN(recname, recnum);
IF <> THEN CALL filerr(-1);
CALL READ(recnum,ci^id,64);
IF <> THEN CALL filerr(recnum);
CALL MYTERM(termname);
CALL OPEN(termname, termnum);
IF <> THEN CALL filerr(-1);
CALL OPEN(supername, supernum);
IF <> THEN CALL filerr(-1);
job.number := current^job := 0;
! Find job most recently opened
job.number.<0> := 1;
job.owner^id := userid;
error^code := SPOOLERSTATUS(supernum, 2, 1, job);
IF error^code <> 0 THEN CALL err(error^code)
ELSE
BEGIN