Leap year detection is quite simple ... every year divisible by 4 unless divisible by 100 except years divisible by 400. But Basic4PPC has a "built in"
leap year detection:
DateParse() returns 0 for non-existent leap days
Thanks, Erel!
B4X:
Sub Globals
End Sub
Sub App_Start
Form1.Show
msgbox("2005: " & leapyear(2005))
msgbox("2004: " & leapyear(2004))
End Sub
sub leapyear(year)
' please keep correct Dateformat() in mind ...
if DateParse("02/29/" & year) = 0 then return False else return True
end sub
DateParse() returns 0 for non-existent leap days