Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 117

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
The CFML Programming Language
<cfscript>
a = 2;
</cfscript>
Variables
CFScript variables can be of any ColdFusion type, such as numbers, strings, arrays, queries, and objects. The CFScript
code can read and write any variables that are available in the page that contains the script. These variables include all
shared scopes, such as session, application, and server variables.
Expressions and operators
CFScript supports all CFML expressions. CFML expressions include operators (such as +, -, EQ, and so on), as well as
all CFML functions.
You can use several comparison operators in CFScript only, not in CFML tags. (You can also use the corresponding
CFML operators in CFScript.) The following table lists the CFScript-only operators and the equivalent operator that
you can use in CFML tags or CFScript:
CFScript operator
==
<
>
For information about CFML expressions, operators, and functions, see
page 64.
Statements
CFScript supports the following statements:
assignment
function call
if-else
switch-case-default
for
The following rules apply to statements:
• You must put a semicolon at the end of a statement.
• Line breaks are ignored. A single statement can cross multiple lines.
• White space is ignored. For example, it does not matter whether you precede a semicolon with a space character.
• Use curly brackets to group multiple statements into one logical statement unit.
• Unless otherwise indicated, you can use any ColdFusion expression in the body of a statement.
Note: For information on the
Statement blocks
Curly bracket characters ({ and }) group multiple CFScript statements so that they are treated as a single unit or
statement. This syntax enables you to create code blocks in conditional statements, such as the following:
CFML operator
EQ
LT
GT
for-in
while
do-while
break
continue
,
, and
function
var
return
Last updated 1/20/2012
CFScript operator
!=
<=
>=
"Using Expressions and Number
try-catch
function (function definition)
var (in custom functions only)
return (in custom functions only)
statements, see
"Defining functions in
CFML operator
NEQ
LTE
GTE
Signs" on
CFScript" on page 154.
112

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents