Token fillers allow you to specify, in the GridTemplate, if you want some text to be appended to the left and/or right of the result of a token, if that result is non-blank. This is useful, for example if you have a combination of tokens in a text box, where one of the tokens may often be blank.
In the example, on the right, if you separate the 2 tokens with a space, then you have an extra space to the left of the moon phase when there is no holiday. |
|
The solution is to use filler tokens and write [fa\/ ][mp] to have a space to the right of the holidays, only if there is a holiday. |
|
To use filler tokens :
•At the end of any token, but before the closing brace, add a pair of filler delimiters. The most commonly-used pair of filler delimiters is the \/ pair (backslash and front slash), but there are other options, which may be needed if the separator you wish to use is a / (front slash), for example. For more details, see the topic on filler delimiters.
•Between the 2 delimiters, place the text that is to appear to the left of the token if its result is not blank. To the right of the 2 delimiters, place the text that is to appear to the right of the token if its result is not blank.
•Which delimiters you use does not matter as long as the text you place to the left and right does not contain one of these delimiters. So, for example, if you want to separate the 2 tokens with a hyphen (-), then you should use the slashes \/ as delimiters.
•Make sure that you specify the delimiters you use in the GridOptions.
Guidelines
Below are some guidelines to help you decide if you should place the filler to the left or right, and in which token.
Suppose you have the 2 tokens [1fa][1mp] (this is valid for any combination of tokens), the table below indicates in which token, and where, to place the filler depending on the text alignment of the 2 tokens, and if you wish the text resulting from these 2 tokens to be on the same line or not.
text |
target |
where to place the filler |
aligned left |
same line |
place filler to the right of the first token [1fa\/ ][1mp] |
separate lines |
place filler to the left of the second token [1fa][1mp\ /] |
|
aligned right |
same line |
place filler to the right of the first token [1fa\/&s][1mp] |
separate lines |
place filler to the left of the second token [1fa][1mp\&s/] |
Tokens inside the filler
You can have tokens in the text to be placed to the left or right, but in that case, as was the case for zap and conditional tokens, the braces must be replaced by underscores. For example :
[1fa\/_d_ _dddd_]
By default the delimiters for the left and right fillers are \ and /, but if you need to use these characters in the filler text itself, you can use the GridOptions property to select another one of the other combinations of filler delimiters, such as _ and -.
Fillers in macro tokens
If you use token fillers inside a macro token, then you should be aware that token fillers 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 filler 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 filler is applied to the macro token as a whole, in a manner similar to the way filler tokens behave normally.
See also: padded tokens and separator tokens.
Topic 154800, last updated on 19-Apr-2020