IIf Function


Returns one of two parts based on a condition.


Syntax

IIf(condition : true part [: false part])

Part Description
condition Required. Any conditional expression, similar to the one you would put on an IF statement.
true part Required. Character expression, which is returned by the function if the evaluated condition is True.
false part Optional. Character expression, which is returned by the function if the evaluated condition is False. If omitted, an empty string is returned.


Remarks

This function is often used to embed conditional output into HTML code.


Example

The following hyperlink points back to the calling program (based on the CALLER variable); however, if the value of CALLER is blank, a default value of 'mainmenu' is used.

<A href="<% IIf(CALLER='' : 'mainmenu' : CALLER) %>.pgm"> Back to Menu </A>


See Also

IF operation code


Profound Logic Software, Inc.
www.ProfoundLogic.com
(937) 439-7925