PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
[Bottom][Contents][Search][Prev]: <?Version>[Next]: Rexx
\ -> Standard Definitions -> <?xXX>

<?xXX>

Any variable which starts with 'x' has a special characteristic in that it is not replaced until just before a line is written to the output file. The only invalid character in the name of the variable is '>'.

The replacements are made in a single pass from left to right. The replacement contents may not itself contain codes you wish to be interpreted in any way, as the text will be output exactly as specified.

You have some control over when the replacement occurs; see the ExpandX option. By default expansion will not occur for commands such as #error, #info and #warning.

The name of the symbol represents a variable whose contents was previously defined with the '=x=' operator of the #RexxVar command (or via the SetXCode() routine).

Variables of this type are useful if you wish to use characters that can't be entered by the editing tool you are using. They also provide an emergency way out which might get you past instances where the character might otherwise be interpreted in a manner other than you wish. For example if you must have the string "<?Version>" in your output (and not have it replaced by the version number)! Another example is that "<?x09>" is the only way to get a tab into the generated output.

This is a Standard Definition which always exists (you don't need to #define it). Note that you can create your own variations or completely new ones (see the examples).

Codes <?x00> to <?xFF>

The 256 REXX variables "x00" to "xFF" have been preset to represent their ASCII character codes. This means that "<?x09>" would get replaced with a tab character and "<?x41>" would get replaced with "A".

You could, if you wished, change the appropriate REXX variables to change the replacement value. For example you could decide the code for "<" gets replaced by "&lt;" instead.

Note that it would generally be better to "name" your ASCII codes as they would then be easier to understand. For example "xTAB" is a lot easier to understand than "x09"!

It is highly recommended that you do not use "<?x0A>" codes to generate newlines; you should use "<?NewLine>".

Example - Using Predefined ASCII Codes

#define Tab    <?x09>

Col1<$Tab>Col2<$Tab>Col3

Example - Creating Your Own Codes

#evaluate 'Tab'       "d2c(9)"
#RexxVar  "TAB"  =x=  "<$Tab>"             ;;TAB Char
#RexxVar  "LA"   =x=  "&lt;"               ;;'<' Char
#RexxVar  "RA"   =x=  "&gt;"               ;;'>' Char

Col1<?xTab>Col2<?xTab>Col3
<?xLA> = Less    than
<?xRA> = Greater than

I have written a script language which gets converted to VbScript code for execution. User parameters are converted to VB string literals with any double quotes being doubled up (VB escape mechanism). Now I created a macro which allows imbedding of VB statements or variables into these literals, to do that the VB statement must not include a double quote (or it will get doubled up as mentioned earlier), so I need to define something which will generate a double quote in the resulting VB:

;--- Allows imbedding of VB statements/variables in "literals" --------------
#RexxVar ^VbDq^ =x= ^"^     ;;Can't use double quotes directly
#define  VBIMBED                                                       \
         <?xVbDq>      ;;End literal with double quote                 \
         &             ;;Concatenate user's VB statement/variable      \
         {$STAT}       ;;User's VB statement/variable                  \
         &             ;;Concatenate rest of literal                   \
         <?xVbDq>      ;;Start Literal

;--- Use the macro to set property in MSI -----------------------------------
<$SetProperty NAME=^<$BSDPROP_BUILT_WSI_TIME>^ VALUE=^<$VbImbed STAT=~VbMadeTime~>^>


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

[Top][Contents][Search][Prev]: <?Version>[Next]: Rexx


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