• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Data Types

ColdFusion variables can hold many different data types. A data type indicates what kind of information is being stored. ColdFusion variables can store data types, such as numbers, text strings, dates, times, and Boolean values, just to name a few. See Table 2.1 for further information on various ColdFusion data types.

Table 2.1. ColdFusion Data Types
Data Type Description
Integers These are whole numbers (numbers without anything to the right of the decimal point), such as 0, –17, and 105.
Real numbers Real numbers, also referred to as floating-point numbers, are numbers that might include a decimal value, such as 3.17, -0.175, and 25.387.
Strings Strings are a sequence of symbols, such as letters, numbers, and special characters. Strings are enclosed by either single or double quotes. For example, "ColdFusion Mentor", 'user@anysite.com', and "10".
Booleans A Boolean value is either True or False. For example, <CFSET UserIsLoggedIn = True>. Boolean values can be expressed in a number of ways. Negative values can be False, No, or 0. Positive vales can be True, Yes, or 1 (or any nonzero number).
Date-time Date-time values can be date only, time only, or a combination of both the date and the time, such as the result of the Now() function.
Lists A list is a string that consists of multiple entries separated by some type of delimiter. The comma is the default delimiter, but others can be specified. Lists will be explained in Step 10. An example might be <CFSET Colors="Red,White,Blue">.
Arrays This complex data type stores information in a table-like structure of rows and columns. Arrays will be explained in Step 10.
Structures This complex data type stores information in a series of key-value pairs. Structures will be explained in Step 10.
Queries This complex data type holds the results of a database query.
Binary Binary data is raw data, such as the contents of a file or an executable program.
Object These are complex object types that are created using the <CFOBJECT> tag. They can include things like COM, Java, and CORBA objects.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint