2.3.4 - Built-in Parameter and Content Handling for Both Styles and Built-ins

Generally, aa_macro syntax inside the braces is: the keyword or stylename, followed by a space, followed by the parameter(s) and/or content. Of which, if there is more than one, may be separated by spaces or commas, and sometimes your own custom separators, depending on the particular built-in and what the parameter is likely to consist of.

If, however, you invoke anything that expects parameters and/or content without a trailing space after the keyword or stylename, it will use the most recently encountered parameter(s.)

So in order to ensure you pass no parameters, you must follow the built-in or stylename with a space. Here's a demonstration using the wordcount built-in:

[wc this is a test]
[wc ]


The content (this is a test) was evaluated once. By this I mean that the content was determined when evaluated during the first  [wc]  invocation, then that content was provided to the second  [wc]  without re-evaluation. The third  [wc]  returned zero because it had a trailing space and no further content.

Another example:

[b fancy [color F84 me] up]

fancy me up
fancy me up
fancy me up

What is happening there is that because   macro()   evaluates from the inside out and then left to right, the actual content that reaches the  [b]  (bold) built-in is the result of the  [color]  built-in, not the  [color]  built-in itself.

So when you intend to provide no content to a style or a built-in that normally expects content or keywords, always put a space after a stylename or built-in.

In the case of something that does not expect content, such as  [co]  (the comma escape), the space is not necessary.

Most of the time this won't cause you any trouble; and from time to time, you may be able to take advantage of the fact that the content of the previous parameter evaluation remains available. - More About Style Parameters

There will be times when you want to pass more than one bit of content to a style, and that is also available as part of the class functionality. You can learn about it below where  [split]  and  [parm]  are described.

Within the built-in reference there are multiple examples of using styles. If you have questions or suggestions, please contact me using the information at the top of the  aa_macro.py  file.

Keyboard Navigation
, Previous Page . Next Page t TOC i Index

Valid HTML 4.01 Loose

This manual was generated with wtfm
wtfm uses aa_macro and SqLite
aa_macro uses Python 2.7