![]() | ![]() | ![]() | ![]() | ![]() |
#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.
A file input dependancy should be defined before the file is used as this ensures that ppwizard can detect changes to the input file even while it is executing. It does not matter when an output dependancy is defined as the timestamp is only read at completion.
If /DependsOn was not specified then the command is ignored.
Syntax |
[WhiteSpace]#DependsOn ["]DepType["] ["]StampWhat1["] ...
The "DepType" parameter indicates should be one of:
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 a files date and time is used for the "stamp" however if the parameter (for an INPUT dependancy) starts with '*' then this has special meaning as follows:
One good example of how to use this is where your build depends on the value of an environment variable (although in this case a "*Exec" of the "set" command would also work in most operating systems).
Example 1 - Two files specified |
#DependsOn INPUT "C:\CONFIG.SYS" "C:\STARTUP.CMD"
Example 2 - Assorted Commands |
#DependsOn INPUT '*TODAY' ;;Rebuild tomorrow #DependsOn INPUT '*EXPIRES=1w' ;;Rebuild in another week #DependsOn INPUT '*EXPIRES=3H' ;;rebuild in 3 hours #DependsOn INPUT '*EXPIRES=NOW' ;;Must always rebuild #dependson INPUT "*CMDLINE" ;;If command line switches change #dependson INPUT "*PpWPGM" ;;If ppwizard program changes in any way #dependson INPUT ^*Rexx=getenv('ppwizard_include')^ ;;If the environment variable changes
Example 3 - 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=')'>
![]() | ![]() | ![]() | ![]() | ![]() |