IIF(expr, truepart, falsepart)
Returns one of two parts, depending on the evaluation of an expression.
|expr||The expression you want to evaluate.|
|truepart||The value or expression returned if "expr" is True.|
|falsepart||The value or expression returned if "expr" is False.|
|* This function always evaluates both truepart and falsepart, even though it returns only one of them. Because of this, you should watch for undesirable side effects. For example, if evaluating falsepart results in a division by zero error, an error occurs even if expr is True.|
* This is also better known as the Immediate If function.
* This function should not be used as it leads to code being harder to read and understand.
* The equivalent .NET function is Microsoft.VisualBasic.Interaction.IIF
* For the Microsoft documentation refer to docs.microsoft.com
IIF(true, "It is true", "it is false") = "it is true"
IIF(false, "It is true", "it is false") = "it is false"
© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited Top