Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 61

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
The CFML Programming Language
Example 1
2 * True + "YES" - ('y' & "es")
Result value as string: "2"
Explanation: (2*True) is equal to 2; ("YES"- "yes") is equal to 0; 2 + 0 equals 2.
Example 2
"Five is " & 5
Result value as string: "Five is 5"
Explanation: 5 is converted to the string "5".
Example 3
DateFormat("October 30, 2001" + 1)
Result value as string: "31-Oct-01"
Explanation: The addition operator forces the string "October 30, 2001" to be converted to a date-time object, and then
to a number. The number is incremented by one. The DateFormat function requires its argument to be a date-time
object; thus, the result of the addition is converted to a date-time object. One is added to the date-time object, moving
it ahead by one day to October 31, 2001.
About scopes
Variables differ in how they are set (by your code or by ColdFusion), the places in your code where they are
meaningful, and how long their values persist. These considerations are generally referred to as a variable's scope.
Commonly used scopes include the Variables scope, the default scope for variables that you create, and the Request
scope, which is available for the duration of an HTTP request.
Note: User-defined functions also belong to scopes. For more information, see
page 173.
Scope types
The following table describes ColdFusion scopes:
Scope
Description
Application
Contains variables that are associated with one, named application on a server. The
attribute or the Application.cfc This.name variable setting specifies the application name. For more information,
see
"Using Persistent Data and
Arguments
Variables passed in a call to a user-defined function or ColdFusion component method. For more information, see
"About the Arguments
Attributes
Used only in custom tag pages and threads. Contains the values passed by the calling page or
the tag's attributes. For more information, see
ColdFusion
Caller
Used only in custom tag pages. The custom tag's Caller scope is a reference to the calling page's Variables scope.
Any variables that you create or change in the custom tag page using the Caller scope are visible in the calling
page's Variables scope. For more information, see
CGI
Contains environment variables identifying the context in which a page was requested. The variables available
depend on the browser and server software. For a list of the commonly used CGI variables, see Reserved Words
and Variables in the CFML Reference.
Locking" on page 301.
scope" on page 161.
Threads" on page 328.
Last updated 1/20/2012
"Specifying the scope of a
"Creating and Using Custom CFML
"Creating and Using Custom CFML
function" on
cfapplication
tag
name
cfthread
tag in
Tags" on page 208 and
"Using
Tags" on page 208.
56

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents