Macros
|
Top |
· | The Macro's expression, after replacing arguments, is actually parsed during the execution of the expression containing the Macro( ) function. This can greatly affect the speed of the parent expression.
|
|
· | The replacement is strictly a text replacement, so the arguments can be anything -- an expression, a variable, or even an operator or function name. It can be any length, and could also be the result of another expression as long as it's a text result.
|
|
· | Since the replacement may be done multiple times as in the example above, be careful what you use. For instance, don't use an argument that should not be executed more than once. Also keep in mind that it will need to be parsed many times (avoid huge expressions as arguments).
|
|
· | Be careful about quotation marks in arguments, like " 'Text' ", if the argument is intended to be a text expression. While the example here is accurate for a text expression, the macro definition might also have quotation marks that conflict, creating an invalid expression (e.g. if the argument is enclosed in other quotation marks).
|