Using Coldfusion Variables - Adobe 38043740 - ColdFusion Standard - Mac Development Manual

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
The CFML Programming Language
• _date
• _time
• _eurodate
Because ColdFusion is not case-sensitive, all of the following are reserved words: IS, Is, iS, and is.
CFScript
CFScript is a language within a language. CFScript is a scripting language that is similar to JavaScript but is simpler to
use. Also, unlike JavaScript, CFScript only runs on the ColdFusion server; it does not run on the client system. A
CFScript script can use all ColdFusion functions and all ColdFusion variables that are available in the script's scope.
CFScript provides a compact and efficient way to write ColdFusion logic. Typical uses of CFScript include:
• Simplifying and speeding variable setting
• Building compact flow control structures
• Encapsulating business logic in user-defined functions
The following sample script populates an array and locates the first array entry that starts with the word "key". It shows
several of the elements of CFScript, including setting variables, loop structures, script code blocks, and function calls.
Also, the code uses a
cfoutput
is often easier to use.
<cfscript>
strings = ArrayNew(1);
strings[1]="the";
strings[2]="key to our";
strings[4]="idea";
for( i=1 ; i LE 4 ; i = i+1 )
{
if(Find("key",strings[i],1))
break; }
</cfscript>
<cfoutput>Entry #i# starts with "key"</cfoutput><br>
You use CFScript to create user-defined functions.
For more information on CFScript, see
information on user-defined functions, see

Using ColdFusion Variables

Adobe ColdFusion variables are the most frequently used operands in ColdFusion expressions. Variable values can be
set and reset, and can be passed as attributes to CFML tags. Variables can be passed as parameters to functions, and
can replace most constants.
To create and use ColdFusion variables, you should know the following:
• How variables can represent different types of data
• How the data types get converted
• How variables exist in different scopes
• How scopes are used
tag to display its results. Although you can use CFScript for output, the
"Extending ColdFusion Pages with CFML
"Writing and Calling User-Defined
Last updated 1/20/2012
cfoutput
Scripting" on page 106. For more
Functions" on page 153.
38
tag

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents