Please enable JavaScript to view this site.


Navigation: Tokens

The Structure of Tokens

Scroll Prev Up Next More

Each token represents a specific way of looking at, and displaying, a date and information that relates to it.


The date of a token is determined by its DayValue and the structure of the scanned Template. This means that every token of the same DayValue corresponds to the exact same date.

It is the difference in TokenRoot (and possibly LanguageTag) that leads to the displaying of different information.


Q++Studio expects tokens to have the following structure (the spaces are there only for clarity):


[LanguageTag DayValue Prefix TokenRoot Suffix]


Some examples of tokens, where the various parts of each token have been color-coded as follows; LanguageTag, DayValue, TokenRoot, Prefix, Suffix:



A letter from 'a' to 'z' denoting the language to use for a particular token. This letter must appear immediately after the opening brace [ of the token.


Most of the time, for single-language diaries, tokens will not need a LanguageTag.


A number from 1 to 1008 (24 times 42) which denotes, with respect to the current grid, which day a token refers to.


For example in a weekly grid, DayValues will range from 1 to 7, 1 referring to the first day of the grid (usually, but not necessarily, Monday).


If the token contains a LanguageTag, then the DayValue occurs immediately after, if not then the DayValue occurs immediately after the opening brace [.


Zero DayValues


You can use 0 (zero) as the DayValue of a token in a grid which is part of a month fit insert, to display a token based on the current month (ie. January for the 2 pages on the left of the example above, and February for the 2 pages on the right of the example above), or check if a date in in the current month as part of a zap or conditional token.


The TokenRoot is the fundamental part of a token. Most of the time the terms token and TokenRoot will be used interchangeably. Click here to go to the list of all TokenRoots.



It is an optional part that, if present, is placed before the TokenRoot. See Token Prefixes.



It is an optional part that, if present, is placed between the TokenRoot and the closing brace. See Token Suffixes.


Some remarks about tokens :


If a token contains no LanguageTag, then Q++Studio will assume it is equal to 'a'.

If a token contains no LanguageTag, then the DayValue can also be omitted.

If a token contains no DayValue, then Q++Studio will assume it is equal to 1.

Tokens are case-sensitive. The tokens [d] and [D] are totally different.

Tokens start with an opening brace [ and end with a closing brace ].

If you wish to use plain text containing braces, make sure you add an underscore to each brace, [_ and _], to specify that the text contained is not a token.

Tokens should generally not contain any spaces (spaces can be included in tokens in a few rare cases, notably in filler suffixes and in holidays response tokens).


Finally, note that the evaluation of tokens is recursive; that means that the result of converting a token can be another token or even a series of tokens.


Topic 000137, last updated on 01-Aug-2020