PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
| Adding Dependencies via a File Mask |
The follow creates macros which can find all files match a mask you supply and call one of the following routines:
Note that there is an INPUT dependancy type of "*Files", this is not the same as using these macros as these macros do not store the mask, just individual files.
The following code has both PPWIZARD and rexx interfaces:
;--- PPWIZARD INTERFACE -----------------------------------------------------
#NextId PUSH ;;Protect any existing namespace
#NextId ;;Start a namespace for the 2 macros below
#( ''
#define DependsOnFiles
#evaluate ^^ ^<$DependsOnFilesRexx {$?}>^
#)
;--- REXX INTERFACE ---------------------------------------------------------
#DefineRexx 'DependsOnFilesRexx'
;--- Validate parameters ------------------------------------------------
{$!:#1,TYPE,SUBDIR}
;--- Get list of files matching mask ------------------------------------
@@Mask = '{$#1}';
@@SubDir = '{$SubDir=^N^}';
call Files4Mask @@Mask, "@@Files", @@SubDir;
;--- Now add each of these files ----------------------------------------
do @@i = 1 to @@Files.0 ;;There may be zero matches (no validation for this)
;--- Add this file --------------------------------------------------
@@File = @@Files.@@i
call Add{$Type}FileToDependancyList @@File;
end;
#DefineRexx
#NextId POP ;;End of custom namespace
;--- Test the above macros (PPWIZARD interface) -----------------------------
;#debug ON
<$DependsOnFiles "c:\tmp\i*.*" type="input">
<$DependsOnFiles "c:\tmp\o*.*" type="output">
<$DependsOnFiles "c:\tmp\t*.*" type="temp">
;#debug OFF