Chapter 4: The Cfml Programming Language; Elements Of Cfml - Adobe 38043740 - ColdFusion Standard - Mac Development Manual

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

Chapter 4: The CFML Programming
Language

Elements of CFML

The basic elements of CFML, including tags, functions, constants, variables, expressions, and CFScript, make it a
powerful tool for developing interactive web applications.
CFML Basics
CFML is a dynamic application development tool with many of the features of a programming language. These
features include functions, expressions, variables and constants, and flow-control constructs, such as if-then and loops.
CFML also has a "language within a language," CFScript, which enables you to use a syntax like JavaScript for many
operations.
These elements and other basic CFML entities such as comments, data types, escape characters, and reserved words,
let you create complex applications.
Comments
ColdFusion comments have a similar format to HTML comments. However, they use three dash characters instead of
two; for example:
<!--- This is a ColdFusion Comment. Browsers do not receive it. --->
The ColdFusion server removes all ColdFusion comments from the page before returning it to the web server. As a
result, the page that a browser receives does not include the comment. Users cannot see the comment even if they view
the page source.
You can embed CFML comments in begin tags (not just tag bodies), functions calls, and variable text in number signs.
ColdFusion ignores the text in comments such as the following:
<cfset MyVar = var1 <!--- & var2 --->>
<cfoutput>#Dateformat(now() <!---, "dddd, mmmm yyyy" --->)#</cfoutput>
This technique can be useful if you want to temporarily comment out parts of expressions or optional attributes or
arguments.
You can also nest comments, as the following example shows:
<!--- disable this code
<!--- display error message --->
<cfset errormessage1="Oops!">
<cfoutput>
#errormessage1#
</cfoutput>
--->
This nesting is useful if you want to temporarily disable a section of code while you test your application.
You can embed comments within comments, however, use this technique carefully.
Last updated 1/20/2012
17

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents