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.:-)