Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IIF nested
Message
From
21/08/2004 14:07:44
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00934989
Message ID:
00935217
Views:
21
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.:-)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform