Please enable JavaScript to view this site.

 

str = GetHolSetNameOverrideOfId(nHolSetId,sHolSetNamesFile)

 

sample sHolSetNamesFile text file

sample sHolSetNamesFile text file

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

 

It works in almost the same manner as the function GetHolSetNameOfId, with the difference that it uses the text file sHolSetNamesFile to override the name of some of the holidays.

 

When this function is called for the holidays set of ID nHolSetId, then the text file sHolSetNamesFile is searched for that ID number. If that ID number is found, then the text on the right of that number, is the result of the function.

 

If no match to the value of nHolSetId is found in the text file sHolSetNamesFile, then the function GetHolSetNameOverrideOfId works the same way as the function GetHolSetNameOfId.

 

The macro code below lists the name of the holidays sets of the a-holidays, using the override name when available.

// get all the holidays sets names of a-holidays
sRESULT = ''
sCurHolList = SetHolidaysList('a')
nListIndex = 1 // the index position in the a-holidays list
nHolidaysSetID = GetNthHolSetId(sCurHolList, nListIndex)
// loop over the HolidaySets in current Holidays List
while nHolidaysSetID <> 0
   // use the current Holidays Set Id (nCurHolSet)
   sResult = sResult + chr(13)
   sResult = sResult + GetHolSetNameOverrideOfId(nCurSetId, 'GermanNames.txt')
   // prepare for next iteration   
   inc(nListIndex)
   nHolidaysSetID = GetNthHolSetId(sCurHolList, nListIndex)
endwhile

If the file name sHolSetNamesFile ('GermanNames.txt' in the example above) is specified without a folder (ie. just the file name), then it will be assumed to be in the folder \Q++ServerXV4\DefaultFiles\.

 

See also: GetHolSetNameOfId.

 


Topic 178625, last updated on 20-May-2020