home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / uedit-stuff_429.lzh / Uedit-Stuff / MessageSend.vlt < prev    next >
Text File  |  1991-01-10  |  1KB  |  49 lines

  1. /* Send a file out VLT 4.824 with delay-per-char, delay-per-line, and
  2.    empty lines padded with spaces.  Currently all adjustment settings are
  3.    compiled in.  Change the next few lines to adjust them. */
  4.  
  5. bunch = 6
  6. linedelay = 15
  7.  
  8. /* it turns out that calling Delay between individual characters is
  9.    ridiculous -- rexx is so farkin slow that just sending the characters
  10.    one at a time with no delay is slower than we probably want!  So the
  11.    number bunch above is: how many characters do we send in one batch
  12.    with no internal delays? */
  13.  
  14. parse arg filename .
  15.  
  16. if ~show('P', 'VLT') then do
  17.     exit 30
  18. end
  19.  
  20. if ~open(foo, filename, 'Read') then do
  21.     exit 20
  22. end
  23.  
  24. if ~show('l','rexxsupport.library') then
  25.     if ~addlib('rexxsupport.library',0,-30) then do
  26.         exit 40
  27.     end
  28.  
  29. if show('Ports', 'Cap2Uedit-signal') then
  30.     address 'Cap2Uedit-signal' foo
  31.  
  32. address VLT 'activate vt100'
  33.  
  34. do while ~eof(foo)
  35.     line = readln(foo)
  36.     l = length(line)
  37.     if l = 0 then address VLT send raw '" "'
  38.     else do i = 0 to (l - 1) / bunch
  39.         if l < bunch then address VLT send '"'right(line, l)'"'
  40.         else address VLT send '"'substr(line, i * bunch + 1, bunch)'"'
  41.         l = l - bunch
  42.     end
  43.  
  44.     address VLT send '"*r*n"'
  45.     if ~(linedelay == 0) then call Delay(linedelay)
  46. end
  47.  
  48. call close(foo)
  49.