Difference between revisions of "IIF()"

From Lianjapedia
Jump to: navigation, search
m (1 revision)
 
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to execute an immediate if
 
Function to execute an immediate if
 
  
 
==Syntax==
 
==Syntax==
 
IIF(<expL>, <exp1>, <exp2>)
 
IIF(<expL>, <exp1>, <exp2>)
 
  
 
==See Also==
 
==See Also==
[[ACC()]], [[CALC()]], [[ICASE()]], [[IF]]
+
[[ICASE()]], [[IF]]
 
+
  
 
==Description==
 
==Description==
The IIF() function returns the value of the expression <exp1> or the value of the expression <exp2>, depending on the result of the expression <expL>.  If the expression <expL> returns .T., the IIF() function returns the value of <exp1>.  If the expression <expL> returns .F., the IIF() function returns the value of <exp2>.  The expressions <exp1> and <exp2> may themselves contain IIF() functions.  The IIF() function may be used anywhere that a normal expression can be used (e.g. as part of expressions in REPORT, DICTIONARY and LABEL formats).
+
The IIF() function returns the value of the expression <exp1> or the value of the expression <exp2>, depending on the result of the expression <expL>.  If the expression <expL> returns .T., the IIF() function returns the value of <exp1>.  If the expression <expL> returns .F., the IIF() function returns the value of <exp2>.  The expressions <exp1> and <exp2> may themselves contain IIF() functions.  The IIF() function may be used anywhere that a normal expression can be used.
 
+
  
 
==Example==
 
==Example==
Line 22: Line 18:
 
</code>
 
</code>
  
 
==Products==
 
Recital Server, Recital
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]

Latest revision as of 10:18, 26 October 2011

Purpose

Function to execute an immediate if

Syntax

IIF(<expL>, <exp1>, <exp2>)

See Also

ICASE(), IF

Description

The IIF() function returns the value of the expression <exp1> or the value of the expression <exp2>, depending on the result of the expression <expL>. If the expression <expL> returns .T., the IIF() function returns the value of <exp1>. If the expression <expL> returns .F., the IIF() function returns the value of <exp2>. The expressions <exp1> and <exp2> may themselves contain IIF() functions. The IIF() function may be used anywhere that a normal expression can be used.

Example

event = "drama"
? iif(event = "drama", "It's for Drama", "It's not for Drama")
It's for Drama