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
Wrap
Text File
|
1992-08-19
|
2KB
|
45 lines
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|| A rather complete wildrun. Take current cmdline, interpret some
|| patterns and replace them with certain fileparts and do this for
|| all selected files. Jens Pirnay
|| Parm Desc Normal example
|| ---- ---- -----------------
|| &f full file name c:\dos\thing.dat
|| &d directory only c:\dos
|| &n file name only thing.dat
|| &r file name root thing
|| &e extension exe
||
(cmd( | only if cmdline is not empty
cmd wld_pattern! | store it
(current.selected | loop over all selected files
( current.name wld_name! | create necessary parts
current.name "." cutfirst wld_ext! | from filename
wld_root! |
cwd current.name makename wld_full! |
wld_pattern | push original pattern on stack
"_" & | add one char, so that a final &_ is recognized
("&f" cutfirst dup (dup)if) | [top+1] part before, [top] after or empty
(wld_full swap & &)
while
("&d" cutfirst dup (dup)if) | [top+1] part before, [top] after or empty
(cwd swap & &)
while
("&n" cutfirst dup (dup)if) | [top+1] part before, [top] after or empty
(wld_name swap & &)
while
("&r" cutfirst dup (dup)if) | [top+1] part before, [top] after or empty
(wld_root swap & &)
while
("&e" cutfirst dup (dup)if) | [top+1] part before, [top] after or empty
(wld_ext swap & &)
while
"_" cutlast drop | remove last dummy character
execute
)if
)loop_panel
refresh
cmd.clear
)if
)wildrun!