PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
[Bottom][Contents][Search][Prev]: $$UPPER[Next]: Dependancies
\ -> Macros -> Macro Transformations -> $$? - User Defined

$$? - User Defined

This is a transformation that can be applied to the substitution of content for both macros and macro parameters.

If the '$$' command is otherwise unknown you can create your own formatting (ie you can not redefine an existing format).

To define a format you need to define a macro which contains the rexx formatting code. The macro must have the name of "REXX_$$" followed by the name of your command, for example to use the command "$$TO_C_STRING" you would create "REXX_$$TO_C_STRING". As parameters begin at the first ":" this character can't be used in the name. The value to be formatted is in the "TheValue" variable. If it has parameters this will be in the "TheParameters" variable (and this should be assigned "" to indicate you processed it).

If required you can also determine the source of the value (macro or parameter name) as it is stored in "TheName" (for case insensitive items it is in upper case). For macro parameters only the name of the macro being expanded is in the "TheMacro" variable.

It is suggested that user macros actually begin with "$$$" so as to prevent any possible clash as PPWIZARD changes in future.

Note that there is a limitation (which requires significant work to remove). Any macros or symbols in the rexx code will not be expanded but simply passed through. This may or may not be an issue depending on what you are trying to do.


This example may be useful if you were creating 'C' code and maybe other situations (in the following example the "\" characters need "escaping":

;--- Define directory (non 'C' format as used elsewhere) ---

;--- Define a macro to transform a string into 'C' format ---
#DefineRexx REXX_$$$TO_C_STRING
            TheValue = ReplaceString(TheValue, '\',     '\\');
            TheValue = ReplaceString(TheValue, '"',     '\"');
            TheValue = ReplaceString(TheValue, d2c(10), '\n');
            TheValue = ReplaceString(TheValue, d2c(13), '\r');
            TheValue = ReplaceString(TheValue, d2c(7),  '\b');

;--- Use our defined transformation ---
StringC = "<$DIR_NAME $$$TO_C_STRING>";

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

[Top][Contents][Search][Prev]: $$UPPER[Next]: Dependancies

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