PPWIZARD Manual
[Bottom][Contents][Search][Prev]: #DefineRexx[+][Next]: #elseif

#DependsOn

This command can be used to indicate a dependancy that is not obvious to PPWIZARD. All input and output files seen by PPWIZARD are automatically taken care of but there may be instances where you might need to indicate other files.

As an example of an INPUT dependancy, you might have a macro which reads parts of CONFIG.SYS (only you know why!) using the rexx linein() function, because your generated output is dependant on the contents of CONFIG.SYS you will wish to rebuild if the file changes.

As an example of an OUTPUT dependancy, you might not wish to use the #output command and therefore directly write to files using a rexx "lineout()" function.

An input dependancy should be defined before the file is used. It does not matter when an output dependancy is defined.

If /DependsOn was not specified then the command is ignored.

Syntax

    [WhiteSpace]#DependsOn  ["]DepType["]  ["]StampWhat1["]  ...
    

The "DepType" parameter indicates whether the following files are input (source) files or output (target) files. A rebuild or your target files is required if there are any input files which have a later date/time than any of your output files. A rebuild is also forced if an input or output file can't be located.

The "StampWhat" parameter(s) are usually the names of files that should be added to the dependancy list. It is not an error (just time consuming) to specify the same item more than once. Normally files date and time is used for the "stamp" however if the parameter starts with '*' then this has special meaning as follows:

Example 1 - Two files specified

    #DependsOn  INPUT   "C:\CONFIG.SYS"   "C:\STARTUP.CMD"
    

Example 2 - Real life macro

   ;--- Outputs the size of a file (takes parameter "File") --------------------
   #define SizeOfFile                                                                                                         \
           #evaluate+  LocalFileName    ^ReplaceString("../{$File}", "/", "\")^                                               \
           #DependsOn  INPUT            "<$LocalFileName>"                                                                    \
           #evaluate+  TmpFileSize      ^AddCommasToDecimalNumber(stream("<$LocalFileName>", "c", "query size"))^             \
           #if "<$TmpFileSize>" = ""                                                                                          \
               #error $Failed getting size of "<$LocalFileName>"$                                                             \
           #endif                                                                                                             \
           <$TmpFileSize>
   #define SizeOfFileInSmallFont   <FONT SIZE=-1>{$Before=""}<$SizeOfFile File=*{$File}*> bytes{$After=""}</FONT>
   #define (SizeOfFileInSmallFont) <$SizeOfFileInSmallFont File=*{$File}* Before='(' After=')'>


[Top][Contents][Search][Prev]: #DefineRexx[+][Next]: #elseif

PPWIZARD Manual
My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Tuesday January 02 2001 at 7:37am