Reset_GetNextDateForHolidayId

Navigation:  Macros > Macro Language > Built-in Functions > All Functions (Alphabetical) >

Reset_GetNextDateForHolidayId

Previous pageReturn to chapter overviewNext page

void = Reset_GetNextDateForHolidayId()

 

This macro function moves the holidays table cursor back to the beginning of the table, and prepares its index for subsequent calls to the function GetNextDateForHolidayId.

 

The macro code below gets the first occurrence of a holiday of nHolId during nYear, and then lists all the other ones (if there are any).

Reset_GetNextDateForHolidayId()
// get first occurrence, if any
nCurDate = GetNextDateForHolidayId(nHolId,nYear)
if nCurDate > 0
   sResult = 'Holiday occurs on ' + FormatDate('mmm d', nCurDate)
    // check if there is another occurrence
    nCurDate = GetNextDateForHolidayId(nHolId,nYear)
    if nCurDate > 0
      sResult = sResult + ', and on '
    endif
    while nCurDate > 0
        sResult = sResult + FormatDate('mmm d', nCurDate) + ','
        // check if there is another occurrence
      nCurDate = GetNextDateForHolidayId(nHolId,nYear)
    endwhile
else
   sResult = 'No occurrence in ' + IntToStr(nYear)
endif

See also: GetNextDateForHolidayId and Reset_FindNextHolidayOnDate.


Topic 110056 updated on 14-Feb-2019.
Topic URL: https://www.qppstudio.net/webhelp_xe3/index.html?reset_getdateforholidayid.htm