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

  1. ; ASCII upload 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 sent
  6.  
  7. filename = ""
  8.  
  9. TRUE=1                       ; boolean values
  10. FALSE=0
  11.  
  12. PaceChar = ""                ; the pace character
  13. LinePace = 0                 ; line pacing, in 1/10 second
  14. CharPace = 0                 ; character pacing, in 1/10 second
  15. StripLF = TRUE               ; TRUE to strip line feed
  16. ExpandBlankLine = TRUE       ; TRUE to expand blank line
  17. XonXoff = FALSE              ; TRUE to handle Xon/Xoff
  18.  
  19. if filename=""               ; input filename if needed
  20.    print
  21.    print "*** Which file: ",
  22.    input filename
  23.    print
  24. endif
  25.  
  26. open filename
  27. if not success
  28.    print "*** Cannot open file"
  29.    stop
  30. endif
  31.  
  32. print "*** Start sending"
  33. set XonXoff,off              ; shut system control temporarily
  34. LastCh = ""
  35. readch ch
  36. while success
  37.    if ch="^M" and LastCh="^J" and ExpandBlankLine
  38.       put " ",
  39.    endif
  40.    LastCh = ch
  41.    if not StripLF or ch<>"^J"
  42.       put ch,
  43.    endif
  44.    if ch="^M"                ; if Carriage-Return
  45.       if PaceChar=""         ; then do line pacing
  46.          delay LinePace      ; or wait for pace character
  47.       else
  48.          waiting = FALSE
  49.          i = 0
  50.          while ch<>PaceChar
  51.             getch ch
  52.             if XonXoff and ch="^S"
  53.                waiting = TRUE
  54.             endif
  55.             if waiting and ch="^Q"
  56.                waiting = FALSE
  57.             endif
  58.             if not success
  59.                if i<LinePace
  60.                   delay 1
  61.                   i = i+1
  62.                endif
  63.             endif
  64.          endwhile
  65.          if waiting
  66.             waitfor "^Q",0
  67.          endif
  68.       endif
  69.    else                      ; if not Carriage-Return
  70.       delay CharPace         ; then do character pacing
  71.    endif
  72.    inputch ch
  73.    if success and ch="^["
  74.       print
  75.       print "*** Aborting sending"
  76.       print
  77.       exit
  78.    endif
  79.    if not connected
  80.       print
  81.       print "*** Carrier lost"
  82.       print
  83.       exit
  84.    endif
  85.    readch ch
  86. endwhile
  87.  
  88. close
  89. clear key
  90.  
  91. if XonXoff
  92.    set XonXoff,on
  93. else
  94.    set XonXoff,off
  95. endif
  96.  
  97.