SUBROUTINE FLCOPY(FNAME,XPERTY,CH1,CH2) C ************************************************** C * * C * S U P E R - M A C * C * * C * PREPROCESSOR * C * * C * FORTRAN VERSION * C * * C * AUTHORS: Thomas J. Weslowski * C * Computer Science Dept. * C * SUNY at Oswego * C * Oswego, NY 13126 * C * * C * and * C * * C * Richard R. DeMidio * C * Instructional Comp. Ctr. * C * Snygg Hall * C * SUNY at Oswego * C * Oswego, NY 13126 * C * * C * MAINTAINER: Edward F. Beadel, Jr. * C * Manager * C * Instructional Comp. Ctr. * C * Snygg Hall * C * SUNY at Oswego * C * Oswego, NY 13126 * C * * C * PHONE: (315) 341-3305 * C * * C ************************************************** C C C COPYRIGHT (c) 1981, 1982, 1983 C BY C Instructional Computing Center C State University of New York at Oswego C Oswego, NY 13126 C C contact: Edward F. Beadel, Jr., Manager C phone: 315/341-3055 C C C This software is furnished in an as-is condition, C with no committments of support or updates. This C software or any other copies thereof may NOT be C sold for profit nor can it be included in any C package to be sold for profit without the written C consent of the author and the coppyright owner. C This software may be used and copied only in ac- C cordance with the terms set forth above and with C the inclusion of the above copyright notice. C C The information in this software is subject C to change without notice and should not be con- C strued as a commitment by The State University of C New York, The C.A.U.S.E. Instructional Computing C Center, the author(s) or maintainer(s) of this C software. C C The State University of New York, The C C.A.U.S.E. Instructional Computing Center, the C author(s), and the maintainer(s) of this software C collectively and individually assume no responsi- C bility for the use or reliability of this C software. C C C C This routine will simply copy the contents of filename C FIL into the file pointed to by logical unit number ONM C FLCOPY declarations BYTE FNAME(12),INS(80),TNS(80) INTEGER CH1,CH2,XPERTY C FLCOPY code GOTO (1,5,3) XPERTY 1 CALL ASSIGN(CH1,FNAME,LEN(FNAME),'RDO') GOTO 5 3 CALL ASSIGN(CH2,FNAME,LEN(FNAME),'NEW') GOTO 30 C Determine how we wish to copy the file 5 CALL GETSTR(CH1,INS,79,ERR) IF(ERR) GOTO 20 WRITE(CH2,25)(INS(I),I=1,LEN(INS)) GOTO 5 C Set up the input file. Then simply write each lin C of the input file to the output file until EOF is reached. 20 IF(XPERTY .EQ. 2) RETURN IF(XPERTY .EQ. 3) CLOSE(UNIT=CH2) IF(XPERTY .EQ. 1) CLOSE(UNIT=CH1) RETURN C This part will copy our final output file. In addition, C it will make it look nice. 30 CALL GETSTR(CH1,INS,79,ERR) IF(ERR) GOTO 20 DO 32 K=1,LEN(INS) IF((INS(K) .NE. ' ') .AND. (INS(K) .NE. ' ')) GOTO 35 32 CONTINUE C Search for position of first non blank, or non tab position 35 CALL SEG(INS,INS,K,LEN(INS)) IF(K .NE. 1) CALL CONCAT(' ',INS,TNS) IF(K .EQ. 1) CALL SCOPY(INS,TNS) WRITE(CH2,25)(TNS(I),I=1,LEN(TNS)) GOTO 30 C Build our string and write it out 25 FORMAT(1X,80A1) END