Please enable JavaScript to view this site.

 

int = GetHolDurationFromTable()

 

This macro function returns the duration of the current holiday (ie. how many days it lasts) in the holidays table.

 

The macro code below looks for the first holiday of nHolSetID on n_TokenDate and displays a message containing the number of days which this holiday lasts for.

// initialize the holidays table
Reset_FindNextHolidayOnDate()
// check if there is a holiday today
if FindNextHolidayOnDate(n_TokenDate, nHolSetID)
   sName = GetHolNameFromTable()
   nNumDays = GetHolDurationFromTable()
   if nNumDays > 1
      sRESULT = 'The holiday "' + sName + '" lasts ' + IntToStr(nNumDays) + ' days'
   else
      sRESULT = 'Holiday "' + sName + '" only lasts one day'
   endif
endif

See also: GetHolDurationPositionFromTable, GetHolNameFromTable.

 


Topic 178275, last updated on 18-Apr-2020