Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
After January 1st
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00308678
Message ID:
00312277
Vues:
47
Hi John,

no question about that, definitely the CASE statement. In a code review I'd flag the second one, because it's less readable, less understandable, less maintainable and more risky. Unless the goal in development was "as little lines as possible", design 1 is always the better choice.


Christof

>>Absolutely, But only in cases where readability is not too much hurt
>
>Lets see...
>
>This
>
>do case
>case mod(nYear, 400) = 0
> lLeapYear = .t.
>case mod(nYear, 100) = 0
> lLeapYear = .f.
>case mod(nYear, 4) = 0
> lLeapYear = .t.
>otherwise
> lLeapYear = .f.
>endcase
>
>Or This...
>
>Leapyear = MOD(nYear,4)=0 AND (MOD(nYear,100) # 0 OR MOD(nYear,400)=0)
>
>My vote is for number 1....
>
>Anybody else...????
--
Christof
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform