Assigns a value depending on the evaluation of an expression. IIf is an abbreviation for Immediate if.
IIf (Expression, TruePart, FalsePart)
Where:
Expression
The returned value is of Boolean type. It is the expression you want to evaluate. Expression can be a formula, a Udp, etc.
TruePart
Return value if the evaluation of Expression is True.
FalsePart
Return value if the evaluation of Expression is False.
Objects: Procedure, Transaction, Web Panel, Work Panel
Generators: .NET, Java, Ruby (up to GeneXus X Evolution 3), RPG, Visual FoxPro (up to GeneXus X Evolution 3), Cobol
This example uses the IIf function to evaluate if &PageName1 is not equal to &PageName2.
&PageNameChanged = iif(&PageName1 <> &PageName2, true , false)
It is exactly the same to:
if &PageName1 <> &PageName2
&PageNameChange = 1
else
&PageNameChange = 0
endif
If command