Programming instructions
16 Chapter 2 CFML Basics
The following figure shows the cfpage.cfm in the browser:
2 Do the following tasks:
a View the source code that was returned to the browser. In most browsers, you can
view the source by right-clicking on page then selecting View Source.
b Compare the browser source code with the source code that appears in your
editor. Notice that the CFML tags were processed on the page but did not appear
in the source that was returned to your browser.
As described in Chapter 1, ColdFusion processes all the instructions (CFML tags
and functions) it receives on a page, and then returns the results of the
instructions that your browser can interpret and display.
Understanding CFML elements
CFML consists of two primary language elements: tags and functions. Ta gs let you
perform operations such as accessing a database. Functions can return data and do other
operations like retrieving the system date. Almost everything you want to accomplish
with ColdFusion will involve using tags and functions.
You will use another important element known as a variable. Variables are an important
part of most programming languages and are equally important with CFML. Variables
let you store information in memory and enable you to pass data.
The following sections describe how to use these three elements.
Tags
You can think of tags as commands that you use to instruct the ColdFusion server to
perform operations. These operations might include selecting data from a database,
reading a file that resides on the server, or showing the results of processing.
Tag syntax
As discussed in Chapter 1, ColdFusion tags are similar to HTML tags. ColdFusion tags
are enclosed in angle brackets and often have a start and end tag. The start tag encloses
the tag name in brackets, like this:
<tagname>