Name
IIf -- returns value depending on the condition (V2.0)
Synopsis
ret = IIf(expr, true_expr, false_expr)
Function
This function checks if the expression expr is True (non-zero). If it is, the function returns the expression specified in true_expr, else false_expr is returned. It is important to note that both true and false expressions are evaluated in every case, no matter if the expression is True or False. So things like IIf(a <> 0, 5 / a, 0) will not work for a=0 because Hollywood will try evaluating 5/0 which obviously does not work.

Inputs
expr
source expression
true_expr
expression to return if expr is True
false_expr
expression to return if expr is False
Results
ret
result

Show TOC