PPWIZARD Manual
[Bottom][Contents][Search][Prev]: Expand Macro Name[Next]: Special MACRO PARAMETER Replacement

Special MACRO Replacement "$$" Commands

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.

Macros parameter where they were supplied on a reference without a value that and begin with '$$' have special meaning, they are commands to PPWIZARD. The command applies to the complete contents of a macro before and replacement of parameters has occurred.

As well as all '$$' commands shown earlier (except the $$PASS ones) these commands are also available:

A simple example where if the "$$SQX2" command were not used that ppwizard would fail (in this case with variable "A" unknown trap):

    #define TheMacro   The value 'A' is in quotes
    #evaluate "" "call Summary 'VALUE', '<$TheMacro $$SQx2>'"
    

Another example where we wish to add commas to a rexx variable:

    Value = <??ARexxVariable $$ADDCOMMA>
    

Here is another example which may be useful if you were creating 'C' code and maybe other situations:

    ;--- Define directory (non 'C' format as used elsewhere) ---
    #define DIR_NAME     C:\DB\PROJECTS\FRED
    
    ;--- 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');
    #DefineRexx
    
    ;--- Use our defined transformation ---
    StringC = "<$DIR_NAME $$TO_C_STRING>";
    

Restriction

Note that most of the above '$$' commands work directly on the contents of the macro. If the contents contains macros then you may not get the desired affect.


[Top][Contents][Search][Prev]: Expand Macro Name[Next]: Special MACRO PARAMETER Replacement

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