Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 119

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
The CFML Programming Language
• All statements end with a semicolon, and line breaks in the code are ignored.
• Assignments are statements, not expressions, and therefore cannot be used in situations that require evaluating the
assignment operation.
• JavaScript objects, such as Window and Document, are not available.
• Only the ColdFusion server processes CFScript. There is no client-side CFScript.
CFScript limitation
You cannot include ColdFusion tags in CFScript. However, you can include
tags, such as
cfoutput.
Using CFScript statements
CFScript includes the following types of statements:
• Assignment statements and functions
• Conditional processing statements
• Looping statements
Using assignment statements and functions
CFScript assignment statements are the equivalent of the
lval = expression;
eval 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
,
, and
switch
case
default
Using if and else statements
The
and
statements have the following syntax:
if
else
if(expr) statement [else statement]
In its simplest form, an if statement looks as follows:
if(value EQ 2700)
message = "You've reached the maximum";
A simple if-else statement looks like the following:
cfset
statements, which are the equivalents of the
Last updated 1/20/2012
blocks inside other ColdFusion
cfscript
tag. These statements have the following form:
,
, and
cfif
cfelseif
cfelse
,
, and
cfswitch
cfcase
114
tags
tags
cfdefaultcase

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents