Navigation:  MCL Reference > Miscellaneous Functions >

ICase( )

Print this Topic Previous pageReturn to chapter overviewNext page

This is a Visual FoxPro function which evaluates the results from a list of conditions.



ICase( lCondition1eResult1, lCondition2, eResult2, eOtherwiseResult])




Specifies a condition as a logical expression to evaluate.

If lCondition evaluates to False (.F.), ICASE( ) continues to evaluate the next condition and returns the corresponding eResult for that condition if it evaluates to True (.T.). If lCondition evaluates to null (.NULL.), Visual FoxPro treats lCondition as if it evaluated to False (.F.).


Specifies a result to return if lCondition evaluates to True (.T.).


Contains the result returned if all conditions evaluate to False (.F.).


Return Value

ICASE( ) returns the first eResult as soon as lCondition evaluates to True (.T.).

If all conditions evaluate to False (.F.), ICASE( ) returns eOtherwiseResult.

If eOtherwiseResult is omitted, and all conditions evaluate to False (.F.), ICASE( ) returns null (.NULL.).


See Also

IIF( )



Page url: