User Defined Flags

  • -D<flag[=value]>

    • CDB: ::FLAG::<flag> <value>
      User defined flags can be set. These are treated by the templatization engine, but they are ignored by the processing script, or the preprocessor. Specifically, -DAnswStruct=foo will *not* be seen by the preprocessor:

::IFDEF:: AnswStruct

// information related to the use of an AnswStruct

// ...

::ELSE::

// no answer struct seen, or it was a -DAnswStruct=value

::ENDIF::

FLAG values are also not known by the processing script, so are in general less likely to have side effects related to their use in templates.

FLAG values are limited to scalar values (no arrays). If you want FLAG arrays, use something like

 

::FLAG::tag1 value1

::FLAG::tag2 value2

...

and template replacement tags like #tag1# and #tag2#.

If you want to set a replacement tag like #Foo# to "" (the empty string), -DFoo is sufficient.