Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IIF nested
Message
De
21/08/2004 14:07:44
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00934989
Message ID:
00935217
Vues:
20
Hi George,

VFP9 has the new ICASE function for these cases:
cColor=ICASE(VARTYPE(nVAL)='U','White',nVal=0,'Black',nVal<1,'Red','Green')
Really cool, and somewhat readable also. At least we don't have to count the all the ( and ) anymore.

>>George,
>>
>>>such as this is in a report text field
>>
>>And then I'd be inclined to the classical IF/ELSEs into a UDF instead of using a too gnarly nested IIF().
>
>df,
>
>Absolutely! I'm speaking in terms of a simple IIF() statement.IOW,
IIF(A, B, C)
Anything beyond that, even if it is faster, is asking for trouble.
>
>Along the same lines, I'm sure that we can expect to see similar abuse with the ICASE() function.
>
>Whoops, sorry. Such remarks are sure to have the "Correctness Police" after us if you agree.:-)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform