Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Leap years
Message
From
08/07/1998 10:27:57
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00115008
Message ID:
00115275
Views:
16
>>Hello All,
>>A simple question but one I have gone completelty blank on.
>>
>>How do I define a leap year?? I know that year % 4 returning a 0 is not enough. What's the rest??
>>
>
>Try
>
>
>cYear= '1998' &&or whatever
>lIsLeapYear = (CTOD('12/31/'+cYear)-CTOD('01/01/'+cYear) = 365)

Good thinking, Ed! Your idea led me to the following simplification:
*---------------------------
FUNCTION IsLeapYear( tcYear)
*---------------------------
RETURN !empty( CTOD( '2/29/' + tcYear))
Rick Borup, MCSD

recursion (rE-kur'-shun) n.
  see recursion.
Previous
Reply
Map
View

Click here to load this message in the networking platform