===IsLeapYear Function to determine if the given year is a Leap Year on the Gregorian (western) calendar=== The following is an MMBasic function to indicate that the given year is a [[https://en.wikipedia.org/wiki/Leap_year|leap year]]. It simply returns a Boolean (actually an integer) of 1 if the year is leap or 0 if not. Faster version eliminates decision making ===Syntax:=== =IsLeapYear(year) ===Example Usage:=== DaysInYear=365+IsLeapYear(year) If IsLeapYear(year) Then... Function IsLeapYear(n As Integer) As Integer IsLeapYear=((n Mod 4=0) And (n Mod 100 <>0)) Or (n Mod 400=0) End Function ===See Also:=== [[IsDate_and_IsTime_functions_VB_Work_A_Like|IsDate and IsTime functions ]]\\