User Guide

Table Of Contents
Tags 29
Note: You cannot embed comments inside a tag name or function name, such as
<cf_My<!--- New --->CustomTag>. You also cannot embed comments inside strings, as in the
following example:
IsDefined("My<!--- New --->Variable").
Tags
ColdFusion tags tell the ColdFusion server that it must process information. The ColdFusion
server only processes tag contents; it returns text outside of ColdFusion to the web server
unchanged. Macromedia ColdFusion MX provides a wide variety of built-in tags and lets you
create custom tags.
Tag syntax
ColdFusion tags have the same format as HTML tags. They are enclosed in angle brackets
(< and >) and can have zero or more named attributes. Many ColdFusion tags have bodies; that
is, they have beginning and end tags with text to be processed between them. For example:
<cfoutput>
Hello #YourName#! <br>
</cfoutput>
Other tags, such as cfset and cfftp, never have bodies; all the required information goes
between the beginning (<) character and the ending (>) character, as in the following example:
<cfset YourName="Bob">
Sometimes, although the tag can have a body, you do not need to put anything in it because the
attributes specify all the required information. You can omit the end tag and put a forward slash
character before the closing (>) character, as in the following example:
<cfexecute name="C:\winNT\System32\netstat.exe" arguments = "-e"
outputfile="C:\Temp\out.txt" timeout = "1" />
Note: The
cfset tag differs from other tags in that it has neither a body nor arguments. Instead, the
tag encloses an assignment statement that assigns a value to a variable. The
cfset tag can also call a
function without assigning a value to a result variable.
Built-in tags
Over 110 built-in tags make up the heart of ColdFusion. These tags have many uses, including
the following:
Manipulating variables
Creating interactive forms
Accessing and manipulating databases
Displaying data
Controlling the flow of execution on the ColdFusion page
Handling errors
Processing ColdFusion pages
Managing the CFML application framework
Manipulating files and directories