![]() ![]() ![]() |
At a basic level, you use expressions in ColdFusion application pages to perform operations on data. Since you can embed expressions in ColdFusion Markup Language (CFML) tags and CFScript blocks, you can create standard programming logic to manipulate data.
For example, you can use expressions in the ColdFusion tags CFSET and CFIF to create standard IF-ELSE statements:
<CFIF 1 + 1 is 2> The world is rational.<BR> <CFELSE> Go home, today's a bad day.<BR> </CFIF>
Some of the uses for expressions are to:
Expressions can contain a wide variety of objects or elements. Expressions can be built using the following components:
For example:
1 + 1
is a mathematical expression that evaluates to 2
.
1 is 2
is a logical expression that evaluates to the string NO
(also the Boolean value FALSE
).
Left("Monkey", 4)
is a string expression that evaluates to the string Monk
.
See the CFML Language Reference for a full catalog of ColdFusion tags and functions.
![]() ![]() ![]() |
AllaireDoc@allaire.com
Copyright © 1998, Allaire Corporation. All rights reserved.