Contents   Index   Previous   Next



§if§

With this macro, you can paste text based on some condition that you have defined yourself. The syntax is

§if <condition>;<thenmacro>;<elsemacro>§

<condition> can be any Boolean condition in PB syntax (it gets evaluated using the PB datawindow evaluation engine). All datawindow functions are allowed.

The condition can include macros. In this case you need to adhere to a certain syntax: macro names are not enclosed in §, but in %.

Example: You have different headers for events and functions. Depending on which routine kind you paste into, you let SmartPaste select the correct macro:

§if '%routinekind%'='Function';functionheader;eventheader§

Note that the then- and else-macros are not to be enclosed in §-characters. The then and the else part have to be names of existing macros. Those macros in turn get evaluated if the condition is true or false.

Using the §if§ macro is based on a thorough understanding of how SmartPaste and also PB expressions work.
Having said this, if conditions are one of the most powerful concepts in SmartPaste.