FUNCTION IFILER(JDECR,QOTFLG) ! Impliment INCLUDE or CHAIN. C+ C Function IFILER recognizes compiler commands that C manipulate source files. C- INTEGER*2 JDECR ! LUN decrement. INTEGER*2 QOTFLG ! Require quoted string if true. INCLUDE 'IPCOMM.FTN' ! Parser common. INCLUDE 'FIGI01.FTN' ! Calculator common. INTEGER*2 IDECR LOGICAL*1 FILNAM(80) ! File name. INTEGER*2 FILLEN ! File name length. INTEGER*2 ISTAT ! Open status. D CALL PSNTRY('IFILER ') ! Trace entry. CALL PSHNML ! Push the usual stuff. IDECR = JDECR ! Save the decrement. IF (SRCLUN .GE. 5) IDECR = 1 ! If not inter, no decr. IF (QOTFLG) GO TO 1100 ! If quotes needed. FILLEN = 0 ! Set up length 1020 IF (.NOT. IPANY()) GO TO 2000 ! If none left. FILLEN = FILLEN + 1 ! Another. FILNAM(FILLEN) = IPMCH ! Save it. GO TO 1020 ! Loop. 1100 IF (.NOT. IQOSTR(80,FILNAM,FILLEN)) ! and not found, 2 GO TO 8200 ! die. 2000 CONTINUE ! Proceed. D WRITE (LUNOUT,2010) SRCLUN, IDECR ! Trace the LUN assign. D2010 FORMAT (' Debug - SRCLUN =',I3,', IDECR =',I3,'.') I = SRCLUN - IDECR ! Find the LUN for file. IF (I .LE. 0) GO TO 8200 ! If max. depth, reject. IF (IDECR .EQ. 0) CLOSE (UNIT=I) ! If needed, close file. CALL SYSOPN(I,FILLEN,FILNAM,ISTAT) ! (Try to) open file. IF (.NOT. ISTAT) GO TO 7900 ! If failed, reject. SRCLUN = I ! Update LUN. GO TO 8000 ! Accept. 7900 WRITE (LUNOUT,7910) (FILNAM(J),J=1,FILLEN) ! Notify user. 7910 FORMAT (' Error - Failed to open input file "', 1 A1,'".') GO TO 8000 ! Accept as being C ! syntactally valid. 8000 CALL POPACC ! Accept the command. IFILER = .TRUE. ! Recognition. RETURN ! Return to caller. 8200 CALL POPREJ ! Reject the command. IFILER = .FALSE. ! No recognition. RETURN ! Return to caller. END