home *** CD-ROM | disk | FTP | other *** search
/ RBBS in a Box Volume 1 #2 / RBBS_vol1_no2.iso / add2 / tm110_1.zip / ASCII-DL.SCR next >
Text File  |  1989-04-06  |  1KB  |  62 lines

  1. ; ASCII download protocol
  2.  
  3. ; if filename is "", you will be asked to input the filename
  4. ; if filename is not "", the specified file will be sent
  5. ;   e.g. if filename="msg.", then the file "msg." will be received
  6.  
  7. filename = ""
  8.  
  9. TRUE=1                       ; boolean values
  10. FALSE=0
  11.  
  12. AddLF = TRUE                 ; TRUE to translate CR as CR-LF
  13. RemoteEcho = FALSE           ; TRUE to echo recieved to remote system
  14.  
  15. if filename=""               ; input filename if needed
  16.    print
  17.    print "*** Which file: ",
  18.    input filename
  19.    clear key
  20.    print
  21. endif
  22.  
  23. create filename
  24. if not success
  25.    print "*** Cannot create file"
  26.    stop
  27. endif
  28.  
  29. print "*** Start receiving"
  30. repeat
  31.    inputch ch
  32.    if success and ch="^["
  33.       print
  34.       print "*** Abort receiving"
  35.       print
  36.       exit
  37.    endif
  38.    getch ch
  39.    if success
  40.       write ch,
  41.       if RemoteEcho
  42.          put ch,
  43.       endif
  44.       if ch="^M" and AddLF
  45.          write "^J",
  46.          if RemoteEcho
  47.             put "^J",
  48.          endif
  49.       endif
  50.    endif
  51.    if not connected
  52.       print
  53.       print "*** Carrier lost"
  54.       print
  55.       exit
  56.    endif
  57. until success and ch="^Z"
  58.  
  59. close
  60. clear key
  61.  
  62.