are the building blocks of the CFML language. In its most basic form,
an expression is nothing more than a single element such as
expressions let you to evaluate data that is acted upon by operators.
1*10 is a mathematical expression
that evaluates to
10. The values
10 are both data, while
the asterisk (
*) is considered an operator. On the
other end of the spectrum, expressions can be complex, consisting of
one or more subexpressions:
<cfset x = 1+(10 mod (3 * (11 - acos(-1))))>
you to perform calculations and make comparisons between expressions.
In other words, they allow you to combine simple expressions to form
ones that are more complex. For example,
<cfset x =
10*(3+2)> uses the asterisk (
*) as an
operator to multiply 10 by the sum of another expression that uses
the plus (
+) operator to add 3 and 2. There are
four types of operators available in ColdFusion:
Performs arithmetic operations such as sign changes, addition, subtraction, etc., on numeric values.
Compares two values and returns a
only one string operator in the CFML language. The ampersand
&) concatenates strings.
as logical operators, Boolean operators perform connective and
negation operations and return Boolean
Table 2-2 lists the operators available in ColdFusion by order of precedence (P).
Table 2-2. ColdFusion ...