Adobe COLDFUSION 9 Manual page 48

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
The CFML Programming Language
"This is a number sign ##"
Lists
ColdFusion includes functions that operate on lists, but it does not have a list data type. In ColdFusion, a list is just a
string that consists of multiple entries separated by delimiter characters.
The default delimiter for lists is the comma. If you use any other character to separate list elements, you must specify
the delimiter in the list function. You can also specify multiple delimiter characters. For example, you can tell
ColdFusion to interpret a comma or a semicolon as a delimiter, as the following example shows:
<cfset MyList="1,2;3,4;5">
<cfoutput>
List length using ; and , as delimiters: #listlen(Mylist, ";,")#<br>
List length using only , as a delimiter: #listlen(Mylist)#<br>
</cfoutput>
This example displays the following output:
List length using ; and , as delimiters: 5
List length using only , as a delimiter: 3
Each delimiter must be a single character. For example, you cannot tell ColdFusion to require two hyphens in a row
as a delimiter.
If a list has two delimiters in a row, ColdFusion ignores the empty element. For example, if MyList is "1,2,,3,,4,,,5" and
the delimiter is the comma, the list has five elements, and list functions treat it the same as "1,2,3,4,5".
Boolean values
A Boolean value represents whether something is true or false. ColdFusion has two special constants—True and
False—to represent these values. For example, the Boolean expression 1 IS 1 evaluates to True. The expression
"Monkey" CONTAINS "Money"
You can use Boolean constants directly in expressions, as in the following example:
<cfset UserHasBeenHere = True>
In Boolean expressions, True, nonzero numbers, and the strings "Yes", "1", "True" are equivalent; and False, 0, and the
strings "No", "0", and "False" are equivalent.
Boolean evaluation is not case sensitive. For example, True, TRUE, and true are equivalent.
Date-Time values
ColdFusion can perform operations on date and time values. Date-time values identify a date and time in the range
100 AD to 9999 AD. Although you can specify just a date or a time, ColdFusion uses one data type representation,
called a date-time object, for date, time, and date and time values.
ColdFusion provides many functions to create and manipulate date-time values and to return all or part of the value
in several different formats.
You can enter date and time values directly in a
<cfset myDate = "October 30, 2001">
evaluates to False.
tag with a constant, as follows:
cfset
Last updated 8/5/2010
43

Advertisement

Table of Contents
loading

Table of Contents