int = SolarEclipseOnDate(nDate, nSunDataSourceIndex)
This macro function calculates the type and time of the solar eclipse, as seen from any location on Earth, on nDate, using the Sun data source of index nSunDataSourceIndex.
•The result is the time of the day expressed in one millionth of a day (less than 1/10th of a second).
•If no solar eclipse occurs on nDate, then the function returns -1.
To separate the type of eclipse from the time, use the div and mod function of the returned result, as shown in the code below.
nComboResult = SolarEclipseOnDate(n_TokenDate, 1)
if nComboResult > -1
nEclipseType = nComboResult div 1000000
sEclipseTypeName = SolarEclipseTypeName(EclipseType)
nEclipseTime = nComboResult mod 1000000
sEclipseTime = FormatTime('hh:nn', EclipseTime, true)
sResult = EclipseTypeName + ' Solar eclipse at ' + EclipseTime
else
sResult = 'No Solar eclipse today'
endif
See also: LunarEclipseOnDate, SolarEclipsePositionMax, SolarEclipsePositionName, SolarEclipseTypeName.
Topic 180030, last updated on 18-Apr-2020