Function If() | IIf() Foundation
Returns the result of an expression dependent on a logical expression.
If( <lCondition>, <ExprTrue>, <ExprFalse>) --> xValue
IIf(<lCondition>, <ExprTrue>, <ExprFalse>) --> xValue
When <lCondition> returns the value .T. (true), the return value of If() is the value of <ExprTrue>, otherwise it is the value of <ExprFalse>. The data type of the return value is the same as the type of the selected partial expression.
The function If() first evaluates the logical expression <lCondition>. Whether <lCondition> provides the value .T. or .F., a second expression is evaluated and the value of this expression is the return value of If(). This function is one of the most efficient and versatile Xbase++ functions. Using it, logical expressions can be converted to any other data type. The function can be written as If() or IIf().
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.