PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
Some PPWIZARD values can be configured via macros. These are extensively used by the #import command as well as to set some less important values.
Due to timing issues some of these can only be set via the the "/define" switch but most can also be set while PPWIZARD is processing your files ("#define" command etc).
You can see macros being used in debug output as it will look similar to:
[0.070] >Option(Macro) "PPWIZARD_FORMAT_DATETIME" not found. Using "%c" [0.070] >Option(Macro) "PPWIZARD_FORMAT_COMPILETIME" was found. Using "%e %B %Y"
If a value is not found it will default to some value (sometimes set via other macros), either way the debug output will show PPWIZARD looking for the macros value.
|Warning - Macros etc are not replaced!|
One important restriction you should be aware of is that unless otherwise specified the value used is expected to be used as is (no macro replacement occurs). Note if the configured value is not processed internally by PPWIZARD but is generated into the output then you could expect macro replacement to occur at that stage, but where PPWIZARD uses the value to configure internals this will never occur.
This restriction means that code such as the following will not work correctly:
#define language SP ;;Which language? ;--- Define month names in different languages --- #define NL_MONTH_NAMES_LONG januari februari maart april mei juni juli augustus september oktober november december #define EN_MONTH_NAMES_LONG Januari Februari March April May June Juli August September October November December #define SP_MONTH_NAMES_LONG Jsadg Feasgd Masadgah Apfdhl Madfhy Jwghdsune Jbcvxhuli Afdbxcvugust jerSeptember Ocjhtobjer Nmcxovember Desddcember ;--- Configure PPWIZARD via macros --- #define PPWIZARD_MONTH_NAMES_LONG <$[language]_MONTH_NAMES_LONG> #define PPWIZARD_FORMAT_COMPILETIME %e %B %Y ========<br> Test the Time => <?Compiletime><br> ========<br>
If you tried the above you will have noticed that the text of the month name does not come out correctly. The problem is with the definition of the "PPWIZARD_MONTH_NAMES_LONG" symbol. PPWIZARD will not expand its contents when looking at the value.
To define it correctly change the definition to:
#option PUSH DefineMacroReplace=YES #define PPWIZARD_MONTH_NAMES_LONG <$[language]_MONTH_NAMES_LONG> #option POP
The above ensures that PPWIZARD has already expanded the information before setting the macros value.