int = MoonRiseSetTimeOf(nDate, nMoonSourceIndex, nEventIndex)
This macro function calculates the time of the lunar rise, set or transit event of index nEventIndex, on nDate, based on the observer position corresponding to the Moon data source of index nMoonSourceIndex.
•The result is the time of the day expressed in one millionth of a day (less than 1/10th of a second). This result can then be converted into hours, minutes and seconds, using the functions HoursFromMillion, MinutesFromMillion, and SecondsFromMillion.
•The possible values of nEventIndex are: 1 (moonrise), 2 (moonset), and 3 (upper transit, aka. in the south).
•If no lunar rise, set or transit event of index nEventIndex occurs on nDate, then the function returns -1.
The macro code below displays the times of the lunar rise, set or transit event of index nEventIndex, on nDate.
sResult = 'Today, the Moon '
nEventTime = MoonRiseSetTimeOf(n_TokenDate, 1, 1)
if nEventTime >= 0
sResult = sResult + 'rises at ' + FormatTime('hh:nn', nEventTime, true) + ', '
else
sResult = sResult + 'does not rise, '
endif
nEventTime = MoonRiseSetTimeOf(n_TokenDate, 1, 3)
if nEventTime >= 0
sResult = sResult + 'transits at ' + FormatTime('hh:nn', nEventTime, true) + ', '
else
sResult = sResult + 'does not transit, '
endif
nEventTime = MoonRiseSetTimeOf(n_TokenDate, 1, 2)
if nEventTime >= 0
sResult = sResult + 'and sets at ' + FormatTime('hh:nn', nEventTime, true) + '.'
else
sResult = sResult + 'and does not set.'
endif
See also: SunRiseSetTimeOf, HoursFromMillion, MinutesFromMillion, SecondsFromMillion, MillionFromHMS.
Topic 179985, last updated on 12-Jul-2024