Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Leap years
Message
De
08/07/1998 02:22:23
 
 
À
08/07/1998 00:25:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00115008
Message ID:
00115163
Vues:
17
>>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform