PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
[Bottom][Contents][Search][Prev]: A Macro Which Expands Another[Next]: Creating HTML pages from Windows URL Shortcuts or OS/2 URL Objects
\ -> Examples / Tips -> Adding Dependencies via a File Mask

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


email me  any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Search][Prev]: A Macro Which Expands Another[Next]: Creating HTML pages from Windows URL Shortcuts or OS/2 URL Objects


PPWIZARD Manual
My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Sunday November 05 2017 at 10:00am