home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 216.lha / RexxArpLib_v2.1 / rexx / filelist / listpattern.txed < prev    next >
Encoding:
Text File  |  1996-02-15  |  1.1 KB  |  53 lines

  1. /* listpattern.txed */
  2. arg duwindow
  3. OPTIONS results
  4.  
  5. if duwindow = "FROM" then devstring = getenv("dufromdir")
  6. else devstring = getenv("dutodir")
  7.  
  8. devstring = strip(devstring)
  9.  
  10.  
  11.   x = request(200,200,"Type filename including wildcards below"," ",,,) 
  12.  
  13.   if x = "" then exit
  14.  
  15.   loccolon = index(x,":")
  16.  
  17.   if loccolon ~=0 then listpat = x
  18.   else listpat = devstring||x
  19.  
  20.   listpat = strip(listpat)
  21.  
  22.   call STATEF(listpat)
  23.   parse var result type rest
  24.  
  25.   address command "list >VD0:DUFROMTEMPLISTING sort nodates "listpat
  26.   LOAD "VD0:DUFROMTEMPLISTING"
  27.  
  28.   'filelist/cleanlast'
  29.  
  30.   MSG listpat
  31.   parse var listpat dev ":" rest
  32.  
  33. if type = "FILE" then do
  34.     listpat = reverse(listpat)
  35.     parse var listpat files "/" dirstring
  36.     dirstring = reverse(dirstring)"/"
  37. end
  38.  
  39. else do
  40.     listpat = reverse(listpat)
  41.     locslash = index(listpat,"/")
  42.     if locslash = 1 then dirstring = reverse(listpat)
  43.     else do
  44.        dirstring = reverse(listpat)
  45.        if rest ~= "" then dirstring = dirstring"/"
  46.     end
  47. end
  48.  
  49. if duwindow = "FROM" then x = setenv("dufromdir",dirstring)
  50. else x=setenv("dutodir",dirstring)
  51.  
  52. exit
  53.