PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
[Bottom][Contents][Search][Prev]: DefineMacroReplace[Next]: ExtraIndent
\ -> Commands -> #option -> DuplicateParms

DuplicateParms=["]Action["]

This determines what to do if a macro is found to use the same parameter name more than once.

Valid options are:

  1. "SAMEOK"
    If the parameter's values (and type) are the same then we won't abort. This is the default action.

  2. "USEFIRST"
    We will keep the first value.

    This could be useful if you have some default parameters that are added to the "end" of whatever the user provided removing the need to look for duplicates yourself. That way, if the user provides a value it overrides the default you set up.

  3. "USELAST"
    We will keep the last value.

    This could be useful if you have some default parameters that are prepended to the "start" of whatever the user provided removing the need to look for duplicates yourself. That way, if the user provides a value it overrides the default you set up.

  4. "ABORT"
    The compile is always aborted.

If not aborting then if a "/ConsoleFile" was specified some information will be written similar to:

[INFO] DUPLICATED MACRO PARAMETERS (Abort prevented: #option DuplicateParms=^USEFIRST^)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NOTICE: The macro parameter "REMOVE" was specified more than once!
WHERE : line 7 of "D:\TMP\TryMe.MM"
#FIRST: `1` (type: V)
#LAST : `2` (type: V)

Example

The following examples shows 2 examples of the "REMOVE" parameter being used twice. No aborts will occur and in the second case "Different1" will be kept:

<$SomeMacro Key="INSTALLDIR" REMOVE="same"  CHANGE="\" MAKE="Y" REMOVE="same">

#option DuplicateParms="UseFirst"
<$SomeMacro Key="INSTALLDIR" REMOVE="Different1"  CHANGE="\" MAKE="Y" REMOVE="Different2" REMOVE="Different3">


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

[Top][Contents][Search][Prev]: DefineMacroReplace[Next]: ExtraIndent


PPWIZARD Manual
My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Saturday May 28 2022 at 2:55pm