Skip to Main Content
Programming ColdFusion MX, 2nd Edition
book

Programming ColdFusion MX, 2nd Edition

by Rob Brooks-Bilson
August 2003
Intermediate to advanced content levelIntermediate to advanced
1140 pages
68h 45m
English
O'Reilly Media, Inc.
Content preview from Programming ColdFusion MX, 2nd Edition

Datatypes

ColdFusion supports a number of datatypes for use in building expressions. These datatypes can be broken into four categories: simple, complex, binary, and object. The simple datatypes are made up of Booleans, strings, numbers (both integer and floating point), and date/time objects:

Boolean

ColdFusion uses the Boolean datatype to store the value generated by a logical operation. Boolean values are stored as either true or false. In numeric operations, Boolean values evaluate to 1 for true and 0 for false. When dealing with strings, Boolean values are set to Yes for true and No for false. Note that no quotes are necessary to delimit Boolean values, nor are Boolean values case sensitive.

Strings

ColdFusion stores text values in strings delimited by a set of single or double quotes. For example, "This is a string." and 'So is this!' are both strings. "1000" and '1000' are also strings so long as the numbers are delimited by a set of quotes. The empty string can be written as either '' or "". There are certain special characters that must be escaped within strings. These special characters are the single quote ('), double quote ("), and pound sign (#). These characters may be escaped by doubling up on them as in the following examples:

<cfset String1 = "This is a ""good"" use of escaped double quotes">
<cfset String2 = "This is a ''good'' use of escaped single quotes">
<cfset String3 = "What is the ##1 team in the league?">

As we’ll discuss in the next section, <cfset> ...

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.
Start your free trial

You might also like

Programming ColdFusion

Programming ColdFusion

Rob Brooks-Bilson

Publisher Resources

ISBN: 0596003803Supplemental ContentErrata Page