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))))>
Operators allow 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 return a
only one string operator in the CFML language. The ampersand
&) concatenates strings.
Also known as logical operators, Boolean
operators perform connective and negation operations and return
Table 2-2 lists the operators available in ColdFusion by order of precedence (P).
Table 2-2. ColdFusion ...