User Guide

14 Developing Web Applications with ColdFusion
Adding More Variables to the Application
Applications can use many different variables. For example, the calldept.cfm
application page can set and display values for department, city, and salary.
To modify the application:
1. Return to the file calldept.cfm in ColdFusion Studio,
2. Modify the code so that it appears as follows:
<HTML>
<HEAD>
<TITLE>Call Department</TITLE>
</HEAD>
<BODY>
<STRONG>Call Department</STRONG>
4 <!--- Set all variables --->
<CFSET Department="Sales">
4 <CFSET City="Boston">
4 <CFSET Salary="110000"
4 <!--- Display results --->
<CFOUTPUT>
4 I’d like to talk to someone in #Department# in #city# who earns at
least #Salary#.
</CFOUTPUT>
</BODY>
</HTML>
3. Save the file.
4. View the page in your Web browser by entering the following URL:
http://127.0.0.1/myapps/calldept.cfm
Development Considerations
The same development rules that apply for any programming environment apply to
ColdFusion. You should also follow the same programming conventions that you
would with any other language:
Comment your code as you go.
HTML comments use this syntax: <!-- html comment -->
CFML comments add an extra dash: <!--- cfml comment --->
File names should be all one word, begin with a letter and can contain only
letters, numbers and the underscore.
File names should not contain special characters.