SUBROUTINE SPOOL(IFN) C Version 01.12 C This routine will request a spool file from the C user, at present all of these files must reside on SYS. C IFN=1: Add a file to spool list C IFN=2: Remove currently printing file from list C IFN=3: Remove Specified file from list C Ralf file called to do spooling contains 3 entry points C SPLGO Start up the spooler initially, or when paused. C A NOP if spooler is running C SPLKIL Kill the currently printing SPOOL task C SPLPSE Pause the current spool task. C The file information is in the array FP, enough room for C 10 files. Since we want this array to be resident in the C background task, and since F4 does not provide us a means C to do this directly (at least one that I have know about), C we define it in a common here so the array references C come out, and then edit the resulting RALF file. C Assemble with the /N/A options. Then edit the RALF source C produced on SYS as follows: C ADD: C EXTERN FP C Search for and delete the common specification: C COMMON SPLQ C FP, ORG .+36 C Close the file and assemble it with RALF DIMENSION FILE(3),FS(2) DATA FILE/'SYS:','SPOOL','.LS'/ INTEGER ERROR INCLUDE STRFUN FORCE N,A COMMON /SPLQ/FP(10) IF(IFN.EQ.0)RETURN 90 GOTO(92,140,91),IFN !Properly dispatch function 92 DO 93 I=1,10 !Find a spool slot IF(FP(I).EQ.0)GOTO 91 !SPOOL list full 93 CONTINUE GOTO 190 91 WRITE(0,100) 100 FORMAT(' ENTER NAME OF SPOOL FILE') CALL RDLIN(0,ITEXT,ERROR) CALL FILNAM(ITEXT,-1,FILE,ERROR) IF(FILE(1).NE.'SYS:')GOTO 200 !Error if not on SYS IF(FILE(2).EQ.' '.OR.FILE(2).EQ.0)RETURN CALL SPLPSE !Pause Q accesses for a moment CALL USR(9,FILE,2,ERROR) IF(ERROR.NE.0)GOTO 210 !File lookup error CALL CHSAV(9,FS) !Get the DSRN for the file IF(IFN.EQ.3)GOTO 130 !Delete file C Copy the important stuff CALL PUTWRD(FP(I),1,GETWRD(FS,3,0)) CALL PUTWRD(FP(I),3,GETWRD(FS,5,0)) I=I+1 IF(I.GT.10)I=1 !Close the ring 128 CALL SPLGO !Start up the SPOOLER GOTO 90 130 CALL SPLPSE !Pause SPOOL JOB DO 135 I=1,10 !Check each SPOOL entry IF(FP(I).EQ.FS(2))GOTO 136 !Match 135 CONTINUE !Loop on all 10 140 CALL SPLKIL !Kill the current SPOOL job IF(IFN.EQ.3)GOTO 90 !If specifying kill, try another RETURN 136 FP(I)=0 !Remove it from the Q GOTO 128 !And restart paused job 190 WRITE(0,191) 191 FORMAT(' SPOOL LIST IS FULL, TRY LATER') RETURN 200 WRITE(0,201) 201 FORMAT(' SPOOL FILE MUST BE ON SYS') GOTO 90 210 CALL USRER(ERROR) GOTO 90