home *** CD-ROM | disk | FTP | other *** search
/ Network CD 2 / Network CD - Volume 2.iso / programs / dopus / arexx_scripts / dopusutils / rexx / multilzh1.dopus < prev    next >
Encoding:
Text File  |  1991-10-14  |  1.8 KB  |  84 lines

  1. /* 
  2.  * 
  3.  *           *******************************
  4.  *           * DOpus LZH Multi-selector    *
  5.  *           *                             *
  6.  *           *      Filename Builder       *
  7.  *           *                             *
  8.  *           * MicroTech Solutions, Inc.   *
  9.  *           *******************************
  10.  */
  11.  
  12. options results
  13.  
  14. address 'dopus_rexx'
  15. toptext "Multi-LZH AREXX by John Crookshank" 
  16.  
  17. count = 1
  18.  
  19. address command
  20. return = Open(infile,"ram:infiles.txt","R")
  21. if return > 0 then do
  22.   do until EOF(infile)
  23.      name.count = ReadLn(infile)
  24.      count = count + 1
  25.      end
  26.   return = close(infile)
  27.   count = count - 1
  28. end
  29.  
  30. address 'dopus_rexx'
  31.   names = ""
  32.   dirs = ""
  33.   getselectedfiles '/' /* get all selected files with | as separator */
  34.   names = RESULT       /* put names in result variable */
  35.   getselecteddirs '/'
  36.   dirs = RESULT
  37.  
  38.   status 3            /* get window number */
  39.   window = RESULT
  40.   status 13 window    /* get path of displayed window */
  41.   path = RESULT
  42.   status 14 window
  43.   vol = RESULT
  44.   parse var path ":" path
  45.  
  46. if names = 'RESULT' & dirs = 'RESULT' then do
  47.   request "No files selected! There's nothing for me to do."
  48.   exit
  49.   end
  50.  
  51. if names ~= 'RESULT' then do
  52.   do while names ~= ""
  53.     parse var names name.count "/" names
  54.     name.count = '"'||vol||':'||path||name.count||'"'
  55.     count = count + 1
  56.     end
  57. end
  58.  
  59. if dirs ~= 'RESULT' then do
  60.   do while dirs ~= ""
  61.      parse var dirs name.count "/" dirs
  62.      name.count = '"'||vol||':'||path||name.count||'/*"'
  63.      count = count + 1
  64.      end
  65. end
  66.  
  67. none   /* clear selected names from file list */
  68.  
  69. address command
  70.  
  71. return = open(outfile,"ram:infiles.txt","W")
  72.  
  73. counter = 1
  74. do until counter = count
  75.    return = WriteLn(outfile,name.counter)
  76.    counter = counter + 1
  77.    end
  78. return = Close(outfile)
  79.  
  80. address 'dopus_rexx'
  81. mssg = (count-1)||' entries are now in the archive list.'
  82. request mssg
  83. exit
  84.