Macro Tokens

Navigation:  Tokens >

Macro Tokens

Previous pageReturn to chapter overviewNext page

Macro tokens are tokens which then get evaluated according to special rules you build yourself using Macros.


Macro tokens have the form :


 [ LanguageTag DayValue * MacroIndex MacroLabel ]


Note that the spaces above have only been inserted for added legibility.


There should be no spaces anywhere in this token, with the possible exception of the Macro Label which is free text.


You must always supply a DayValue. In the case of Macro tokens, you cannot use the shortcut that a DayValue of 1 can be omitted. In fact, if you use macro tokens to replace [d] tokens, make sure you use DayValue Marker tokens so Q++Studio can tell which dates belong to which pages.


Sample macro tokens would be :





The Macro Index is a number from 1-30. Note that the indices you use do not need to be consecutive. For example it is perfectly acceptable to have a *1 and a *12 macro in a GridTemplate. The Macro Index is used in the Macros property to associate a Macro with each token of a given Macro Index.


The Macro Label can be any text any text you wish in analogy to the labels used for slogan tokens. As mentioned above this label can contain text, and even the * character. Although the Macro Label is reminiscent of the slogan tokens' labels, there are some key differences :


The Macro Label is used by Q++Studio as the value of the s_TokenRoot system variable which is supplied to your Macros automatically.


You can have many different tokens having the same Macro Index, but different Macro Labels. Not only is this allowed, but it is also a very common and powerful time-saving trick, which we will discuss in the next topic.


Important: Note that filled tokens and padded tokens behave differently, depending on the text result of a macro. If you use filling or padding inside a macro token, then you should be aware that token filling or padding will be inserted differently, depending if the result of the macro contains other tokens or not. If the result of the macro contains tokens, then it is assumed that the filling or padding should be inserted into each of the result's tokens. However, if the result of the macro is text that does not contain any tokens, then the filling or padding is applied to the macro token as a whole, in a manner similar to the way filling or padding tokens behave normally.


See also: Color Macros.

Topic 108473 updated on 03-May-2018.
Topic URL: