Please enable JavaScript to view this site.

 

Navigation: Macros > Macro Language > Built-in Functions > All Functions

GetHolTextOverrideFromTable

Scroll Prev Up Next More

str = GetHolTextOverrideFromTable(sHolNamesFile,bFullText)

 

This macro function returns the plain text part of the current holiday in the holidays table.

 

The current holiday in the holidays table is due to previous calls to functions which move the cursor in the holidays table, such as FindNextHolidayOnDate and GetNextDateForHolidayId.

 

The function GetHolTextOverrideFromTable works in almost the same manner as the function GetHolTextFromTable, with the difference that it uses the text file sHolNamesFile to override the name of some of the holiday names, usually for conciseness, in the case of lengthy names, or for political reasons, as in the examples below.

 

sample sHolNamesFile text file

sample sHolNamesFile text file

meaning of bFullText

meaning of bFullText

 

The parameter bFullText specifies if you also want the text of the holiday name variations (bFullText = true) or just the text of the first line of the holiday name (bFullText = false), as shown in the example above right.

 

The ID of the holidays need to be specified in the text file, below left, but the call to GetHolTextOverrideFromTable does not require the holiday ID as it is the ID of the current holiday in the table. If no match is found in the text file sHolNamesFile, then the function GetHolTextOverrideFromTable works the same way as the function GetHolTextFromTable.

 

The macro code below checks if there is an override text for the current holiday.

sTextNormal = GetHolTextFromTable(false)
sTextOverride = GetHolTextOverrideFromTable(false)
bHasOverride = (sTextNormal <> sTextOverride)

If the file name sHolNamesFile ('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: GetHolTextFromTable.

 


Topic 178630, last updated on 18-Apr-2020