![MACROMEDIA COLDFUSION 5-DEVELOPING Develop Manual Download Page 32](http://html1.mh-extra.com/html/macromedia/coldfusion-5-developing/coldfusion-5-developing_develop-manual_3293641032.webp)
12
Chapter 2 Writing Your First ColdFusion Application
Compare the code that was returned to the browser with what you originally
created. Notice that the ColdFusion comments and CFML tags are processed, but
do not appear in the HTML file that is returned to the browser.
Reviewing the code
The application page that you just created contains both HTML and CFML. You used
the CFML tag
cfset
to define a variable, Department, and set its value to “Sales.” You
then used the CFML tag c
foutput
to display text and the value of the variable. The
following table describes the code and its function:
Original ColdFusion page
HTML file returned by Web server
<html>
<head>
<title>Call Department</title>
</head>
<body>
<strong>Call Department</strong><br>
<!--- Set all variables --->
<cfset department="Sales">
<!--- Display results --->
<cfoutput>
I’d like to talk to someone in
#Department#.
</cfoutput>
</body>
</html>
<html>
<head>
<title>Call Department</title>
</head>
<body>
<strong>Call Department</strong><br>
I’d like to talk to someone in Sales.
</body>
</html>
Code
Description
<!--- Set all variables --->
CFML comment, which is not returned in the
HTML page.
<cfset Department="Sales">
Creates a variable named Department and sets
the value equal to Sales.
<!--- Display results --->
CFML comment, which is not returned in the
HTML page.
<cfoutput>
I’d like to talk to someone in
#Department#.
</cfoutput>
Displays whatever appears between the opening
and closing
cfoutput
tags; in this example, the
text “I'd like to talk to someone in” is followed by
the value of the variable Department, which is
“Sales.”
Summary of Contents for COLDFUSION 5-DEVELOPING
Page 1: ...Macromedia Incorporated Developing ColdFusion Applications MacroMedia ColdFusion 5 ...
Page 58: ...38 Chapter 3 Querying a Database ...
Page 134: ...114 Chapter 7 Updating Your Database ...
Page 210: ...190 Chapter 10 Reusing Code ...
Page 232: ...212 Chapter 11 Preventing and Handling Errors ...
Page 238: ...218 Chapter 12 Using the Application Framework ...
Page 262: ...242 Chapter 12 Using the Application Framework ...
Page 278: ...258 Chapter 13 Extending ColdFusion Pages with CFML Scripting ...
Page 320: ...300 Chapter 15 Indexing and Searching Data ...
Page 336: ...316 Chapter 16 Sending and Receiving E mail ...
Page 374: ...354 Chapter 18 Interacting with Remote Servers ...