Please enable JavaScript to view this site.

 

str = GetHolSetNameOfId(nHolSetId)

 

This macro function returns the name of the holidays set with ID given by nHolSetId.

 

It can be used to display the name of countries as headers in international holidays pages such as in the example below. The country names could be written-out in the template, but this could hide problems, should the list of countries change, or be re-ordered. So it is better to have the names generated based on the current order of holidays sets in an aeiou-holidays list.

 

 

The macro code below reads-out the last 2 characters of the macro token, to obtain the index of the holidays set in the list and then uses the function GetHolSetNameOfId to return its name.

// get the last 2 characters of the macro token
sIndex = StrCopy(s_TokenRoot, StrLength(s_TokenRoot)-12)
nIndex = IntToStr(sIndex)
// get the holidays set ID of the index position nIndex in a-holidays 
nSetID = GetNthHolSetId('a',nIndex)
// get the name of that holidays set ID
sResult = GetHolSetNameOfId(nSetID)

See also: GetNthHolSetId, GetHolSetAbbreviationOfId.

 


Topic 174570, last updated on 01-Aug-2020