home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / decpro300 / proboot.for < prev    next >
Text File  |  2020-01-01  |  997b  |  30 lines

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