home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / FileMover / Dopus4 / ArexxScripts / MultiLHArexxScript.lzx / REXX / MultiLHA1.rexx next >
Encoding:
OS/2 REXX Batch file  |  1994-12-03  |  1.6 KB  |  86 lines

  1. /*  
  2.  *******************************
  3.  * DOpus LHA Multi-selector    *
  4.  *                             *
  5.  *      Filename Builder       *
  6.  *                             *
  7.  * $VER: 2.0 © RAM ® TGI 1994  *
  8.  *******************************
  9.  */
  10.  
  11. DOpusPort = 'DOPUS.1'
  12.  
  13. if ~show(l,"rexxsupport.library") then        
  14.     call addlib("rexxsupport.library",0,-30,0)
  15.  
  16. /* make sure we've got somebody to talk to */
  17.  
  18. if showlist('Ports', DOpusPort) = 0 then do
  19.    say 'Directory Opus ARexx port not found. Aborting.'
  20.    call CleanUp
  21. end
  22.  
  23. address 'DOPUS.1'
  24. options results
  25.  
  26. toptext "TGI-SERVICES 1994 / Multi-LHA by RAM" 
  27.  
  28. count = 1
  29.  
  30. address command
  31. return = Open(infile,"ram:infiles.txt","R")
  32. if return > 0 then do
  33.   do until EOF(infile)
  34.      name.count = ReadLn(infile)
  35.      count = count + 1
  36.   end
  37.   return = close(infile)
  38.   count = count - 1
  39. end
  40.  
  41. address 'DOPUS.1'
  42. names = ""
  43. status 3 window
  44. window=result
  45. status 9 window
  46. entries=result
  47.  
  48. do entries
  49.   getnextselected
  50.   names=insert(names,result)
  51.   names=insert(names,'/')
  52.   selectfile result 0 1
  53. end
  54.  
  55. status 3            /* get window number */
  56. window = RESULT
  57. status 13 window    /* get path of displayed window */
  58. path = RESULT
  59.  
  60. if names = '' then do
  61.   request "No files selected! There's nothing for me to do."
  62.   exit
  63. end
  64.  
  65. do while names ~= ""
  66.   parse var names name.count "/" names
  67.   name.count = path||name.count
  68.   count = count + 1
  69. end
  70.  
  71. address command
  72.  
  73. return = open(outfile,"ram:infiles.txt","W")
  74.  
  75. counter = 1
  76. do until counter = count
  77.    return = WriteLn(outfile,name.counter)
  78.    counter = counter + 1
  79.    end
  80. return = Close(outfile)
  81.  
  82. address 'DOPUS.1'
  83. mssg = (count-1)||' entries are now in the archive list.'
  84. request mssg
  85. exit
  86.