PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
{$![:List]} - Die When Unused Parms |
The subject of macros is reasonably complex (but well worth learning) please ensure you have at least read the macro introduction before reading this section.
While PPWIZARD does show unused parameters when in debug mode, this does not cause ppwizard to complain. This is because there are a number of situations (some coding style issues as well) where you can expect to find some parameters whose values were not expanded by a macro.
While PPWIZARD does not know if unused parameters might indicate an error, you do, so you can tell ppwizard to die if a macro is passed parameters that it does not use.
You may not always get this error, for example if a manditory parameter was mispelt it would fail because the parameter was missing but it does provide some helpful extra validation.
Some common mistakes that could be detected by this validation include:
This validation may slow down processing slightly but is probably worth it anyway if others will be using your macros. You could compromise and limit the validation to externally known macros and keep "internal" ones unvalidated.
This feature works in two "modes":
At the end of the macros expansion PPWIZARD will look for unused parameters and report these.
The main situation where you are likely to get a false hit is where a parameter's value is only used as a default for another parameter. In cases like this you could use the parameter with the '$$IGNORE' command so as to expand to nothing but mark the parameter as used. Otherwise if you get a false hit remove the validation on those macros or alter your style.
The "ParmVal" option influences the operation of this type of validation.
This can handle situations that the first type of validation may not be able to handle or it can be used simply to make the parameters being passed more obvious.
The "ParmVal" option can be used to turn off the validation.
Example |
;--- Define a macro that takes no parameters --- #define EMAIL fred@home.com{$!} ;--- Correct Use (no parameters) --- VALUE: <$EMAIL> ;--- Incorrect Use (some parameters) --- VALUE: <$EMAIL X=1 Y=2 "3">