Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Leap years
Message
From
08/07/1998 02:22:23
 
 
To
08/07/1998 00:25:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00115008
Message ID:
00115163
Views:
18
>>>How do I define a leap year?? I know that year % 4 returning a 0 is not enough. What's the rest??
>>>
>>>Thanks
>>Sandy,
>>
>>Since everyone's giving you function ideas, here's mine:
>>* ldtdate is a DATE or DATETIME
>>lnyear = YEAR(ldtdate)
>>llisleap = (lnyear % 4 = 0) AND ((lnyear % 100 # 0) OR (lnyear % 400 = 0))
>
>
>And here is mine:
>
> function LeapYear(tnYear)
> return (tnYear % 4) = 0
>
>Good for the last 97 and the next 101 years...
>
>(which brings us full circle to Sandy's original
>concept.)
>
>Bet that outlasts FoxPro!
>
>Peter Robinson :-)

Even though the useful "lifetime" of any particular piece of software is probably getting shorter and shorter before it's replaced, this is exactly the kind of thinking that gave us the "Y2K" problem to begin with! Who REALLY KNOWS if that will "outlast FoxPro" or not??? ;-) But also, who really knows if our current calendar will still be in use that far in the future?!?!

It's just a roll of the dice...
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform