[GenTokens] Options

Navigation:  ScriptLine Properties > Grid Options > Recursive Tokens >

[GenTokens] Options

Previous pageReturn to chapter overviewNext page

The [GenTokens] GridOptions, located at the right of the Grid Options property editor, are used to specify how the [GenTokens] tokens are processed for the current GridTemplate. There are 12 identical sets of options, relating to the tokens [GenTokens1] to [GenTokens12] respectively.

 

 

The top part of each set of options specifies the text and tokens that should appear on each line, and the range of dates for which these lines should be generated.

 

 

You can place any combination of text and tokens in the Text and Tokens to display on each generated line field, but you must make sure that you do not use any DayValues in the tokens. Instead, place a pound sign "#" (without the quotes) where a DayValue should occur. At run-time, Q++ will replace these # by the proper DayValues.

 

 

Note that these # signs are to be used exactly as if they were a DayValue, in particular, if you need to specify the language of a token, then any LanguageTag should occur between the opening brace and the # sign, as shown in the example above. If you do not specify a LanguageTag then Q++ will use the LanguageTag of the incoming [GenTokens].

 

The Blank lines on outside days option ensures that any line generated that corresponds to an outside day will be generated as a blank line (ie. it will not contain the text and tokens from the above field but if specified in line endings options below, it will display paragraph attributes corresponding to any condition based on outside days). This can be useful to be able to place all tokens in the same textbox and still be able to set the Monthly Outside Days GridOption to Delete or Group Delete. If that is your intention, and the DayValue of the [GenTokens] token is potentially outside the month, then make sure that you place a Never Delete Token in front of the [GenTokens] token.

 

The Begin on Weekstart option should be checked if you wish the GenTokens to begin on the first day of the week that contains the first of the month, as opposed to starting on the first of the month (the weekday used to determine the start of the week is the one specified in the Week Start option of the GridOptions ScriptLine property). The difference between setting this option to true or false, is akin to the 2 possible choice for the First Date of Template setting of monthly grids. If you plan to use GenTokens with the Begin on Weekstart option on, inside a minicalendar, then you should make sure that you add an Embedded Tokens Date Modifier to your minicalendars.

 

The Generate lines until option is used to tell Q++ how many lines should be generated.

 

 

 

The possible values are :

 

End of MonthUsing this setting will generate as many lines as are necessary, starting on the date of the token and ending at the end of that month. Note that the calculation takes into account the value of the First Date of Template property of the current Template, so that in the case of a value of Week of the 1st, the number of lines will usually be more than the number of days in the month, since these grids start at the beginning of the week prior to the 1st of the month.

 

Relative DayValueUsing this setting will generate lines until the DayValue relative to the DayValue of the GenToken reaches a certain value. By relative, we mean within the same month (ie. modulo 42). So for example, if we have a [85GenTokens1] token and a relative DayValue of 17, then lines will be generated for DayValues from 85 to 101 (= 2*42 + 17).

 

Day of MonthThis setting is useful when months are split across 2 columns. An example may have [1GenTokens1] running until the Day of Month 17, and an [18GenTokens2] running until the End of the Month.

 

Number of LinesThis setting is also useful when months are split across 2 columns. An example may have both a [1GenTokens1] and an [17GenTokens2] running for 16 lines. The advantage here is that both columns are handled by the same special case, leaving other special cases available and at the very least avoiding having to specify the same settings twice (and remember to modify them both when the need arises). The additional options Min of Nbr of Lines or EOM and Max of Nbr of Lines or EOM allow you to ensure that Q++ stops inserting line endings if the end of the month is reached.

 

The Number of Lines setting, when selected, displays an additional control Step by. By default, its value is 1, meaning that each new line corresponds to a date 1 day later then the previous line. By changing this value, to 7 for example, you can display thicker lines to separate months in planner-style diaries such as the one below.

 

 

 

In the example above, the horizontal rules are diplayed using one vertical textbox per weekday, with GenTokens running from [1GenTokens1] to [7GenTokens1], each a Number of Lines value of 27 and using a Step by value of 7 days.

 

The Line Endings and Formatting option is used to specify the type of paragraph line ending that is used at the end of each generated line. You can specify the default line ending to use and also different line endings (and paragraph formatting to use in special cases.

 

 

Default line ending

This setting specifies which Line Ending Settings to use by default, ie. if none of the Special Cases below are true. Note that if you select Hard Return for this setting, each line generated will have the paragraph attributes of the current [GenTokens]. This is important because, if there is no paragraph mark after the GenTokens token, any rules above/below that are part of the paragraph attributes of the token will not be visible in the GridTemplate, but will become visible in the output file because each generated line ends with a line ending (even the last generated line).

No line ending when token line is blank

This setting allows you to specify that there should be no line ending whenever the series of tokens converts to a blank line. This is particularly useful to generate monthly or yearly tables of events that do not occur everyday (holidays, planetary events, ...). This is similar, but more powerful than using duration suffixes with holidays tokens. Note that this option considers a token line to be blank if all it contains is non-visible characters and spaces, so that a line containing a tab and a Moon token would be counted as blank on dates when there are no Moon phases, although the tab is still there.

 

You can also specify a series of Special Cases that require the line ending and paragraph formatting to be special. Each Special Case is made up of a checkbox that enables or disables it, a set of conditions that determine if the special case is occurring or not, and specific paragraph formatting to be used if the special case is true.

 

 

For example, you might want to separate weeks with a line under and shade dates of the current week.Such an example would be handled by special cases as follows :

 

 

Note that Q++ stops testing is special cases are true as soon as it finds one case that matches. Therefore, if both case 1 and 3 are true, only case 1 will be handled. To avoid such issues that come from the order of cases, make sure that you not only specify the conditions that must be true, but also those that must be false.

 

To see the details of the condition or line ending used, without modifying it, you do not need to click on the button edit; simply place your mouse over the contol and a popup hint will display a summary of the settings used.

 

   

 

To avoid having to copy multiple settings manually between the various GenTokens, you can use the Copy to/from button located at the top right of the tabsheet to copy GenTokens options and sub-options all at once.


Topic 175265 updated on 02-May-2016.
Topic URL: http://www.qppstudio.net/webhelp/index.html?gentokens.htm