Please enable JavaScript to view this site.

 

int = SunEarliestLatestSunrise(nDate, nSunDataSourceIndex)

 

This macro function checks if the date nDate corresponds to the earliest or latest sunrise of the year, based on the observer position corresponding to the Sun data source of index nSunSourceIndex.

 

The result is 1 for the earliest sunrise of the year and 2 for the latest sunrise of the year.

If nDate does not correspond to the latest or earliest sunrise of the year, then the function returns 0.

 

The macro code below displays which of the earliest/latest sunrise/sunsets occur on nDate, if any.

sBuffer = ''
switch SunEarliesLatestSunrise(n_TokenDate, 1)
    case 1
        sBuffer = 'Earliest sunrise in ' + IntToStr(n_TokenYear)
    case 2
        sBuffer = 'Latest sunrise in ' + IntToStr(n_TokenYear)
endswitch
switch SunEarliesLatestSunset(n_TokenDate, 1)
    case 1
        sBuffer = 'Earliest sunset in ' + IntToStr(n_TokenYear)
    case 2
        sBuffer = 'Latest sunset in ' + IntToStr(n_TokenYear)
endswitch

See also: SunEarliestLatestSunset.

 


Topic 178535, last updated on 18-Apr-2020