Contents   Index   Previous   Next



§cond§

Some special macros translate to the empty string when matched to the context of a special script. For instance the list of parameters is empty (an empty string) if you paste it in a script without parameters.

You can insert a conditional text into your macro that only is inserted if the following macro text translate to something different than the empty string.

Suppose you want to call a function with all your parameters:

of_Trace("functionname", ax_param1, ax_param2, ax_param3).

In the edit macro window you would edit the macro like this:

of_Trace("§routinename§", §parms n§)

Now, if you have 3 parameters (as_text, ab_ok, adt_date), then the result would be something like this:

of_Trace("of_WriteText", as_text, ab_ok, adt_date)

But if you do not have any arguments to your function, the macro would resolve to

of_Trace("of_WriteText", )

The comma will result in a syntax error!

For this type of macros, you can use the §cond§-Macro. This macro is only inserted if the macro following it does not yield the empty string. The text you want to paste is included in the macro within single or double quotes:

of_Trace("§routinename§"§cond ', '§§parms n§)

Now you will receive either

of_Trace("of_WriteText", as_text, ab_ok, adt_date)

or

of_Trace("of_WriteText")

depending on whether you have some arguments or there are none.

You can also use the §cond§-macro for parameters the user supplied (or did not).