View comments | RSS feed
Contents > Developing ColdFusion MX Applications > Elements of CFML > Data types PreviousNext

Data types

ColdFusion is considered typeless because you do not explicitly specify variable data types. However, ColdFusion data, the constants and the data that variables represent, do have data types, which correspond to the ways the data is stored on the computer.

ColdFusion data belongs to the following type categories:

Category

Description and types

Simple

Represents one value. You can use simple data types directly in ColdFusion expressions. ColdFusion simple data types are:

  • strings, such as "This is a test."
  • integers, such as 356
  • real numbers, such as -3.14159
  • Boolean values, True or False
  • date-time values, such as 3:00 PM July 12, 2001

Complex

A container for data. Complex variables generally represent more than one value. ColdFusion built-in complex data types are:

  • arrays
  • structures
  • queries

Binary

Raw data, such as the contents of a GIF file or an executable program file

Object

COM, CORBA, Java, web services, and ColdFusion Component objects: Complex objects that you create and access using the cfobject tag and other specialized tags.

For more information on ColdFusion data types, see Using ColdFusion Variables.


Contents > Developing ColdFusion MX Applications > Elements of CFML > Data types PreviousNext

ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

Comments


a440guy said on Jun 14, 2004 at 11:07 AM :
This "discussion" of data types is almost useless. It should actually describe the data types. Instead, it gives one or two examples, or nothin at all!. Really Bad!

Here are some things that I have learned by trial and error that are the kinds of things that should be in this section the ONLY section that purports to talk about data types:

All simple data types are basically strings. A string in ColdFusion is written as a sequence of alphanumeric characters enclosed in single or double quotes. Strings that look like integers or real numbers can usually and should usually be written without the quotes, especially when doing mathmatical operatons on them. Valid boolean values for true are "yes", "true", true, "1", 1 . Valid boolean values for false are "no", "false", false, "0", 0 . The character sequences yes, no, false, and true can be any mixture of upper- and lower-case letters. A date-time value (also referred to in the documentation as a date-time "object") is actually just a string in a special format. 2:30 PM on June 14, 2004 is represented as:

{ts '2004-06-14 14:02:30'}

where "ts" stands for "timestamp", etc. A date value is "{d '2004-06-14'}" and a time value is {t '14:02:30'}

This page also need a description of an array and a structure, including what types of data can be stored in each. I won't write it all for you, but you get the idea, I hope.

repre
marnen said on Aug 11, 2005 at 4:40 PM :
The organization is not that clear, but this page merely appears to be an
overview. See http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/
variabl5.htm and following pages for a detailed explanation of data types.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/elemen15.htm