A rigid algorithm for determining leapyears

'----------------------------------------------------------------------------
SUB LeapYr(Year%, LeapYear$)

    ' Accepts Year% as integer of year concerned
    ' Returns LeapYear% as 1 if year is leap year, 0 if not.
    ' (NB: I wrote this "perpetual" leap year sub routine years ago tho'
    '      the penultimate line will not be used again until the year 2100
    '      and the last until 2400. But they have been used during my term
    '      as webmaster.)

    LeapYear% = 0
    IF Year% = 4   * INT((Year%)/4  ) THEN LeapYear$ = 1 ' every 4th year
    IF Year% = 100 * INT((Year%)/100) THEN LeapYear$ = 0 ' unless century
    IF Year% = 400 * INT((Year%)/400) THEN LeapYear$ = 1 ' not divisible by 400

END SUB
'----------------------------------------------------------------------------
To use the rigid version, change the lines in sub-routine LeapYr:
IF Year% = 4*INT(Year%/4) THEN MID$(Mn$,8,1)="1"
    ' If leapyear, February has 1 day more than 28
    ' NB: Simplified algorithm OK until 2100
For:
CALL LeapYr(Year%, LeapYear$) : MID$(Mn$,8,1)= LeapYear$
    ' If leapyear, February has 1 day more than 28
    ' NB: Rigid algorithm OK beyond the date when the "Sales" close
    '     and sofas are sold at list price!!