Tag
Indexed
cfloop
Conditional cfloop
Structure cfloop
cfbreak
cftry,
cfcatch
cfcookie
cfobject
Using CFScript statements
The following sections describe how to use these CFScript statements:
•
Assignment statements and functions
•
Conditional processing statements
•
Looping statements
Using assignment statements and functions
CFScript assignment statements are the equivalent of the
following form:
lval = expression;
lval is any ColdFusion variable reference; for example:
x = "positive";
y = x;
a[3]=5;
structure.member=10;
ArrayCopy=myArray;
You can use ColdFusion function calls, including UDFs, directly in CFScript. For example, the
following line is a valid CFScript statement:
StructInsert(employee,"lastname",FORM.lastname);
Using conditional processing statements
CFScript includes the following conditional processing statements:
•
and
statements, which serve the same purpose as the
if
else
tags
•
,
switch
case
and
cfdefaultcase
132
Chapter 6: Extending ColdFusion Pages with CFML Scripting
CFScript equivalent
for loops
while loops and do while loops
for in loop. (There is no equivalent for queries, lists, or objects.)
break statement. CFScript also has a continue statement that has no
equivalent CFML tag.
try and catch statements
Direct assignment of Cookie scope memory-only variables. You cannot
use direct assignment to set persistent cookies that are stored on the
user's system.
CreateObject
, and
statements, which are the equivalents of the
default
tags
function
tag. These statements have the
cfset
cfif
,
, and
cfelseif
cfelse
,
cfswitch
cfcase
,
Need help?
Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?
Questions and answers