BackUp LevelNext

CFIF CFELSE CFELSEIF

Used with CFELSE and CFELSEIF, CFIF lets you create simple and compound conditional statements in CFML. The value in the CFIF tag can be any expression.

Syntax

<CFIF expression>
    HTML and CFML tags
<CFELSE>
    HTML and CFML tags
<CFELSEIF expression>
    HTML and CFML tags
</CFIF>

Usage

Note that when testing for the return value of any function that returns a Boolean, you do not need to explicitly define the TRUE condition. The following code uses IsArray as an example:

<CFIF IsArray(myarray)>

When successful, IsArray evaluates to YES, the string equivalent of the Boolean TRUE. This method is preferred over explicitly defining the TRUE condition:

<CFIF IsArray(myarray) IS TRUE>




BackUp LevelNext

allaire

AllaireDoc@allaire.com
Copyright © 1998, Allaire Corporation. All rights reserved.