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.
➢Independent search positions: the 2 groups of macro functions, FindNextHolidayOnDate / Reset_FindNextHolidayOnDate and GetNextDateForHolidayId / Reset_GetNextDateForHolidayId, use separate cursors to access the same holidays data. Each reset function resets only the cursor used by its corresponding search function. Consequently, macros can contains loops, mixing these groups of functions without losing the outer loop’s search position.
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()
sResult = ''
nCurDate = GetNextDateForHolidayId(nHolId, nYear)
while nCurDate > 0
if sResult <> ''
sResult = sResult + ', '
endif
sResult = sResult + FormatDate('mmm d', nCurDate)
nCurDate = GetNextDateForHolidayId(nHolId, nYear)
endwhile
if sResult == ''
sResult = 'No occurrence in ' + IntToStr(nYear)
else
sResult = 'Holiday occurs on ' + sResult
endif
See also: GetNextDateForHolidayId and Reset_FindNextHolidayOnDate.
Topic 110056, last updated on 11-Oct-2026