Please enable JavaScript to view this site.

 

GenTokens GridOptions, located at the top right of the grid options dialog in the second tab of the recursive tokens section, are used to specify how 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.

 

Text and Tokens to display on each generated line

 

You can place any combination of text and tokens, including special character markers, in the Text and Tokens to display on each generated line field.

 

You must make sure that you do not use DayValues in the tokens. Instead, place a pound sign "#" (without the quotes) where a DayValue should occur. At run-time, the # will be replaced by the proper DayValues, based on the values you set for Generate Lines Until and Step By, described further down this topic, starting at the DayValue of the current GenTokens token.

 

The # signs are to be used exactly as if they were a DayValue, in particular, if you need to use a macro, then the macro index should go after the # sign, such as in [#*1d]. Similarly, if you need to specify the language of a token, then any LanguageTag should occur between the opening brace and the # sign, such as [b#Dddd]. If you do not specify a LanguageTag then the LanguageTag of the incoming [GenTokens] will be used.

 

You can use special cases to override the text and tokens to display for some particular occasions.

 

Blank lines on outside days

 

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.

 

Begin on WeekStart

 

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 script line 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.

 

Generate lines until

 

The Generate lines until option is used to tell Q++Studio how many lines should be generated. The possible values are:

 

End of Month

Using this setting will generate as many lines as are necessary, starting on the date of the token, not necessarily the first day of the month, 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 DayValue

Using this setting will generate lines until the DayValue relative to the DayValue of the GenTokens 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 Month

This 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 Lines

The Number of Lines setting allows you to specify that the GenTokens should run for a specific number of lines, regardless of the number of days in each month.

 

This setting, when selected, displays an additional control Step by which allows you to specify that each new line generated is more than one day after the previous one.

 

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 shown on the right (or here).

 

In the example above, the horizontal rules are displayed 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.

 

To determine how many times to step by 7 days, you can refer to the minimum and maximum number of weeks needed to cover a given number of months table found in the appendices

Minimum Number of Lines or EOM

This setting is a variation of the Number of Lines setting, above, and is usually used when months are split across 2 columns, and you wish to have the same index GenTokens for both halves of the month.

 

This setting, when selected, displays an additional control Step by which allows you to specify that each new line generated is more than one day after the previous one.

 

Using this setting, lines will be generated until the number specified is reached, or the end of the month is reached, whichever comes first.

 

This setting is useful when the first half of the month has 16 or more days (i.e. when the Number of Lines setting is 16 or above), to prevent too many lines from being generated in the second column.

Number of Lines / EOM

This setting is a variation of the Number of Lines setting, above, and is usually used when months are split across 2 columns, and you wish to have the same index GenTokens for both halves of the month.

 

This setting, when selected, displays an additional control Step by which allows you to specify that each new line generated is more than one day after the previous one.

 

Using this setting, lines of the first half of the month will be generated until the number specified is reached, and lines of the second half of the month will be generated until the end of the month is reached.

 

This setting is useful when the first half of the month has 15 or less days (i.e. when the Number of Lines setting is 15 or less), to ensure that enough lines are generated in the second column to reach the end of the month.

 

The determination of whether a GenTokens token is in the first or second half of the month is based on the DayValue of the current GenTokens token. A GenTokens token with a DayValue below 10, such as [8GenTokens1] will be treated as being in the first half of the month, while a GenTokens token with a DayValue below 10, such as [16GenTokens1] will be treated as being in the second half of the month.

 

Line Endings and Formatting

 

The Line Endings and Formatting settings are 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.

 

 

Special Cases

 

You can also specify a series of Special Cases that apply special line ending and paragraph formatting (you can also override the text and tokens to display for some particular occasions).

 

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++Studio 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 control and a pop-up 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.

 

See also: GenTokens Tokens, Special Case Conditions, Line Endings and Formatting, Copying GenTokens Options.

 


Topic 175265, last updated on 19-Feb-2023