home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
SAAREXX.ZIP
/
TRYIT.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1991-08-03
|
3KB
|
69 lines
/*-- REXX ------------------------------------------------------------*/
/* */
/* Module Name: TRYIT.CMD */
/* */
/* Function: REXX exec example for XMPMAIN.EXE. */
/* */
/* Author: W. David Ashley */
/* */
/* Date: 02 August 1991 */
/* */
/* (C) W. David Ashley 1991 */
/* */
/* Modifications: */
/* -------- --- --------------------------------------------------- */
/* 08/02/91 WDA Initial Release */
/* */
/*--------------------------------------------------------------------*/
if arg() <> 1 then do
say 'Invalid input argument.'
exit 4
end
arg file
/* the following will load the external function if this REXX cmd */
/* is running standalone (not invoked from XMPMAIN.EXE) */
if rxfuncquery('RexDir') then do
call rxfuncadd 'RexDir','XMPFXDLL','REXDIR'
dropextfunc = 1
end
else do /* we're running under XMPMAIN.EXE */
dropextfunc = 0
end
call delentries '.'
if dropextfunc = 1 then call rxfuncdrop 'RexDir'
exit 0
/*--------------------------------------------------------------------*/
/* */
/* delentries */
/* */
/* Delete file from current and lower subdirectories. */
/* */
/*--------------------------------------------------------------------*/
delentries: procedure expose file
arg fspec
/* get directory listing of the current directory */
retc = RexDir(fspec || '\*.*', 'line', 'B')
if retc <> 0 | line.0 = 0 then do
say 'Error reading directory' fspec
exit
end
do i = 1 to line.0
if pos('<DIR>', line.i) > 0 & substr(line.i, 39, 1) <> '.' then do
call delentries fspec || '\' || substr(line.i, 39)
end
end
'del' fspec || '\' || file
return