MACROMEDIA COLFUSION MX 7-CFML Reference page 653

Cfml reference
Hide thumbs Also See for COLFUSION MX 7-CFML:
Table of Contents

Advertisement

IIf
Description
Evaluates a Boolean conditional dynamic expression. Depending on whether the expression is
true or false, dynamically evaluates one of two string expressions and returns the result. This
function is convenient for incorporating a
For general conditional processing, see
information, see ColdFusion MX Developer's Guide.
Returns
If result is True, returns the value of
value of
Evaluate(string_expression2)
Category
Decision
functions,
Function syntax
IIf(condition, string_expression1, string_expression2)
See also
,
DE
Evaluate
Parameters
Parameter
condition
string_expression1
string_expression2
Usage
The
function is a shortcut for the following construct:
IIf
<cfif condition>
<cfset result = Evaluate(string_expression1)>
<cfelse>
<cfset result = Evaluate(string_expression2)>
</cfif>
The expressions string_expression1 and string_expression2 must be string expressions, so that they
are not evaluated immediately as the parameters of
IIf(y is 0, DE("Error"), x/y)
If
, this generates an error, because the third expression is the value of x/0 (invalid
y = 0
expression).
ColdFusion evaluates string_expression1 and string_expression2. To return the string itself, use the
function.
DE
cfif
Evaluate(string_expression1)
Dynamic evaluation functions
Description
An expression that can be evaluated as a Boolean.
A string or a variable that contains one. Expression to evaluate and return if
condition is True.
A string or a variable that contains one. Expression to evaluate and return if
condition is False.
tag in-line in HTML.
cfif
. For error handling, see
.
. For example:
IIf
. For more
cftry
; otherwise, returns the
IIf
653

Advertisement

Table of Contents
loading

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents