Reserved Words; Differences From Javascript - MACROMEDIA COLDFUSION 5-DEVELOPING Develop Manual

Table of Contents

Advertisement

248
continue: skip to next loop iteration
for ( loop=1; loop LT 10; loop = loop+1)
{
}
break: break out of the current switch statement or loop
indx = 0;
for( ; ; )
{
}
return, var: See "Defining and Using Custom Functions" on page 250

Reserved words

In addition to the names of ColdFusion functions and words reserved by ColdFusion
expressions (such as NOT, AND, IS, and so on), the following words are reserved in
CFScript. Do not use these words as variables or identifiers in your scripting code:
for
else
default
var

Differences from JavaScript

CFScript is similar to JavaScript, however, there are some key differences in CFScript:
Note
CFScript is not directly exportable to JavaScript. Only a limited subset of JavaScript
can run inside CFScript.
if(a[loop] EQ 0) continue;
a[loop]=1;
indx=indx+1;
if(Find("key",strings[indx],1))
break;
while
switch
in
return
It uses ColdFusion expressions, which are neither a subset nor a superset of
JavaScript expressions. For example, there is no < operator in CFScript.
It does not have user-defined variable declarations.
It is case-insensitive.
All statements end in a semicolon, and line breaks in the code are ignored.
Assignments are statements, not expressions.
Some implicit objects are not available, such as Window and Document.
Chapter 13 Extending ColdFusion Pages with CFML Scripting
do
case
continue
if
break
function

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 5

Table of Contents