home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / m / msh21.zip / MSHFILES.ZIP / WILDRUN.MSH < prev   
Text File  |  1992-08-19  |  2KB  |  45 lines

  1. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  2. || A rather complete wildrun. Take current cmdline, interpret some
  3. || patterns and replace them with certain fileparts and do this for
  4. || all selected files.                                  Jens Pirnay
  5. ||     Parm      Desc           Normal example
  6. ||     ----      ----          -----------------
  7. ||      &f   full file name    c:\dos\thing.dat
  8. ||      &d   directory only    c:\dos
  9. ||      &n   file name only    thing.dat
  10. ||      &r   file name root    thing
  11. ||      &e   extension         exe
  12. ||
  13. (cmd(                               | only if cmdline is not empty
  14.   cmd wld_pattern!                  | store it
  15.   (current.selected                 | loop over all selected files
  16.     ( current.name wld_name!              | create necessary parts
  17.       current.name "." cutfirst wld_ext!  | from filename
  18.       wld_root!                           |
  19.       cwd current.name makename wld_full! |
  20.       wld_pattern    | push original pattern on stack
  21.       "_" &          | add one char, so that a final &_ is recognized
  22.       ("&f" cutfirst dup (dup)if)         | [top+1] part before, [top] after or empty
  23.       (wld_full swap & &)
  24.       while
  25.       ("&d" cutfirst dup (dup)if)         | [top+1] part before, [top] after or empty
  26.       (cwd swap & &)
  27.       while
  28.       ("&n" cutfirst dup (dup)if)         | [top+1] part before, [top] after or empty
  29.       (wld_name swap & &)
  30.       while
  31.       ("&r" cutfirst dup (dup)if)         | [top+1] part before, [top] after or empty
  32.       (wld_root swap & &)
  33.       while
  34.       ("&e" cutfirst dup (dup)if)         | [top+1] part before, [top] after or empty
  35.       (wld_ext swap & &)
  36.       while
  37.       "_" cutlast drop                    | remove last dummy character
  38.       execute
  39.     )if
  40.   )loop_panel
  41.   refresh
  42.   cmd.clear
  43. )if
  44. )wildrun!
  45.