Please enable JavaScript to view this site.

 

Navigation: Tokens > Holidays Tokens

[ifHol] Holidays Response Tokens

Scroll Prev Up Next More

Holidays Response Tokens are used to display some text (including special characters) if and only if the result of converting various independent holidays tokens is different from a blank space.

 

A common example is when there are 2 lists of holidays in a diary, one official, non-working list, usually displayed in red or magenta, and a non-official list of holidays, usually displayed in black.

 

In the above example, the • character is only inserted if both the list of a-holidays and the list of e-holidays, are non-blank. An additional advantage of Holidays Response Tokens is that their format and color can be set directly (in this example, whether the • should appear in magenta or black is a matter of choice).

 

Structure

 

The structure of this token is as follows:

 

 [ifMarker:HolListTok:ResultText]

 

HolListTok

 

HolListTok specifies which holidays tokens we wish to check, and is made-up of a list of single characters, each representing a possible holidays token. The correspondence between these characters and various holidays tokens is as follows (the table below also applies to moving the position of the week number based on other events in start of week tokens):

 

a e i o u

Corresponds to the [fa]..[fu] holidays name token.

â ê î ô û

Corresponds to the [â]..[û] holidays symbols token.

à è ì ò ù

Corresponds to the [fâ]..[fû] holidays abbreviation token.

á é í ó ú

Corresponds to the watermark token.

ä ë ï ö ü

Corresponds to the saints tokens.

m

Corresponds to the Moon phase token [mp] (calculated using the first moon data source)

s

Corresponds to the season token [se] (calculated using the first sun data source)

z

Corresponds to the sun in zodiac token [sz] (calculated using the first sun data source)

 

ifMarker

 

The ifMarker determines if we are looking for all the holidays tokens specified in HolListTok to be non-blank, or for any one of them only, and can have one of the following values:

 

ifHol

Checks if any of the tokens referred to by the HolTokList is non-blank.

ifHOL

Checks if all of the tokens referred to by the HolTokList is non-blank.

ifHoL

Checks if at least 2 (ie. one pair) of the tokens referred to by the HolTokList is non-blank.

if~Hol

Checks if none of the tokens referred to by the HolTokList is non-blank (this is the opposite of ifHol, hence the ~ used).

if~HOL

Checks if at least one of the tokens referred to by the HolTokList is blank (this is the opposite of ifHOL, hence the ~ used).

if~HoL

Checks if none, or only one, of the tokens referred to by the HolTokList is non-blank (this is the opposite of ifHoL, hence the ~ used).

 

If the condition of the ifMarker is true for the series of holidays tokens referred to by HolListTok, then the token will be replaced by ResultText.

 

Examples

 

[3ifHol:aeâê:/]

This token will be replaced by a front-slash (/) if the combined result of the tokens [3fa] [3fe] [3â] [3ê] is not blank (ie. if any of these 4 tokens is not blank).

[2ifHOL:aë:, ]

This token will be replaced by a comma and a space, if the result of each one of the tokens [2fa] [2:st_e] is not blank (ie. if all 2 tokens are not blank).

[5if~Hol:aeî:&c]

This token will be replaced by a hard return if the combined result of the tokens [5fa] [5fe] [5î] is blank. This can thus be used to show alternative text when there are no holidays of the specified tokens.

 

Additional tips

 

The ResultText can contain other tokens, in which case the [] braces should be replaced by _ underscores (this is the same convention as the one used to include tokens inside zap tokens).

If you want the result of a Holidays Response Token to cause the current textbox to be deleted you can use zap as ResultText (or ZAP to delete the current textbox and any object that is grouped with it).

You can add a duration suffix to perform the response over a period of time longer than a day. For example, [1ifHOL:ae: / :m+00] would be converted to " / " if there was at least one a-Holiday and one e-Holiday in the current month.

You can use using specific holidays sets modifiers within Holidays Response Tokens. For example is you wanted to add a bullet if there was a holiday for both [fa:1] and [fe:2] then you would use the Holidays Response Token [ifHOL:a1e2:•].

 


Topic 178150, last updated on 13-Dec-2022