int = MoonLoreNumHours(nDate, nRuleID, nMoonDataSourceIndex)
This macro function returns the number of hours for which the Moon lore rule nRuleID matches on nDate, using the Moon data source explicitly selected by nMoonDataSourceIndex. It uses the matching time intervals remaining after the rule's Required conditions, Exclusions and full-day options have been applied.
All remaining intervals are added together, including separate intervals during the same date. The function then adds one minute to this total and truncates the result to whole hours. This allowance is applied once to the total, not separately to each interval; the result is not rounded to the nearest hour.
For example, two separate 40-minute intervals total 80 minutes and return 1. A total of 58 minutes returns 0, while a total of 59 minutes 30 seconds returns 1 after the allowance. No matching intervals returns 0. Consequently, 0 can also mean that a short matching interval exists; it does not always mean that the rule never matches during the date.
The Result is a full day option expands a matching tab result before exclusions are subtracted. A full-day Required match with no exclusions returns 24. Exclusions can reduce that total, so selecting the option on Required does not guarantee a result of 24.
See also: MoonLoreRuleImage, MoonLoreRuleSymbol, MoonLoreRuleDescription, MoonLoreRuleName.
Topic 181085, last updated on 11-Oct-2026