CHARACTER FILNM*20,LINE*80,SENTNL*1 WRITE (UNIT=05,FMT=02) 02 FORMAT (1X,'Please type the name of the file to be sent') READ (UNIT=05,FMT=05) FILNM 05 FORMAT (A20) OPEN (UNIT=00,FILE=FILNM,STATUS='OLD') 10 READ (UNIT=05,FMT=20) SENTNL C This format statement might have to be changed for some systems 20 FORMAT (1X,A1) 22 IFLAG=0 READ (UNIT=00,FMT=25,END=999) LINLEN,LINE(1:LINLEN) C The "Q" in the following format reads the integer number of characters C left on the line (length of the line). 25 FORMAT (Q,A) 27 WRITE (UNIT=05,FMT=30) LINE(1:LINLEN) 30 FORMAT (1x,A) 99 READ (UNIT=05,FMT=20) SENTNL IF (SENTNL.EQ.'Y') GOTO 22 ! GOT AN ACK C IF (SENTNL .EQ. 'y') GOTO 22 ! Other type of ACK IF (SENTNL.EQ.'N') GOTO 27 ! GOT A NAK IF (SENTNL.NE.'U') GOTO 99 ! Must have gotten something useless IFLAG=IFLAG+1 ! MUST HAVE AN UNKNOWN (OR MESSED UP) COMMAND IF (IFLAG.GT.20) GOTO 22 ! MUST REALLY BE UNKNOWN GOTO 27 ! TRY THE LINE AGAIN 999 READ (UNIT=05,FMT=20) SENTNL STOP END