Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 65

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
The CFML Programming Language
Scope prefix
Prefix required to
reference
(type)
thread-local (no
none
prefix)
URL
No
Variables
No
(Local)
Using scopes
The following sections provide details on how you can create and use variables in different scopes.
Evaluating unscoped variables
If you use a variable name without a scope prefix, ColdFusion checks the scopes in the following order to find the
variable:
1
Local (function-local, UDFs and CFCs only)
2
Arguments
Thread local (inside threads only)
3
4
Query (not a true scope; variables in query loops)
5
Thread
Variables
6
CGI
7
8
Cffile
URL
9
Form
10
11
Cookie
Client
12
Because ColdFusion must search for variables when you do not specify the scope, you can improve performance by
specifying the scope for all variables.
To access variables in all other scopes, you must prefix the variable name with the scope identifier.
Scopes and CFX tags
ColdFusion scopes do not apply to ColdFusion Extension (CFX) tags, custom tags that you write in a programming
language such as C++ or Java. The ColdFusion page that calls a CFX tag must use tag attributes to pass data to the CFX
tag. The CFX tag must use the Java Request and Response interfaces or the C++ Request class to get and return data.
Where available
Within a thread created by the
cfthread
On the target page of the URL.
On the current page. Cannot be accessed by a
form's action page (unless the form page is also
the action page). Variables in this scope used on
a page that calls a custom tag can be accessed in
the custom tag by using its Caller scope;
however, they are not available to any nested
custom tags.
Last updated 1/20/2012
Created by
tag
Using no prefix when you create the variable.
You can also use the keyword var before the
variable name.
The system. Contains the parameters passed in
the URL query string used to access the page.
Specifying the prefix Variables, or using no
prefix, when you create the variable. (To create a
Variables scope variable inside a ColdFusion
thread, you must use the Variables prefix.)
60

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents