Skip to Content
Programming ColdFusion
book

Programming ColdFusion

by Rob Brooks-Bilson
August 2001
Intermediate to advanced
976 pages
38h 8m
English
O'Reilly Media, Inc.
Content preview from Programming ColdFusion

Expressions

Expressions are the building blocks of the CFML language. In its most basic form, an expression is nothing more than a single element such as 1, test, MyVar, or CHR(54). Compound expressions let you to evaluate data that is acted upon by operators. For example, 1*10 is a mathematical expression that evaluates to 10. The values 1 and 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

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:

Arithmetic

Performs arithmetic operations such as sign changes, addition, subtraction, etc., on numeric values.

Comparison

Compares two values and return a Boolean True/False.

String

There is only one string operator in the CFML language. The ampersand (&) concatenates strings.

Boolean

Also known as logical operators, Boolean operators perform connective and negation operations and return Boolean True/False values.

Table 2-2 lists the operators available in ColdFusion by order of precedence (P).

Table 2-2. ColdFusion ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Programming ColdFusion MX, 2nd Edition

Programming ColdFusion MX, 2nd Edition

Rob Brooks-Bilson

Publisher Resources

ISBN: 1565926986Catalog PageErrata