Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Coding puzzle 2
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00664570
Message ID:
00664648
Vues:
36
>>Ok, that 'puzzle' from Hilmar was far too easy (took me 10 seconds, ok .. 30).
>>
>>Here's a nice contest. Who can write the shortest function (using native vfp functions/commands) that returns a person's age. Input is the birthday and the current date. The winner will get 3 points from me!
>
>Hmmm... FAQ#7797 ? :)

Looking at that post, I'd say that Gérald Santerre had the shorter function since he simplified
((MONTH(ldMdate)*100 + DAY(ldMdate)) >= (MONTH(ldDob)*100 + DAY(ldDob)) 
to
RIGHT(DTOS(ldMdate),4) >= RIGHT(DTOS(ldDob),4) 
although he used the less than sign and reversed the order of the IIF() clauses to make a shorter expression.

(and that's my to cents worth)
-Lou.
"All my life I said I wanted to be someone ...
I can see now that I should have been more specific." -Jane Wagner
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform