
111
DEVELOPING
COLDFUSION 9 APPLICATIONS
The CFML Programming Language
Las
t
upda
te
d 8/5/2010
Example
The following example loops through a query in CFScript:
...
<cfscript>
// Loop through the qGetEmails RecordSet
for (x = 1; x <= qGetEmails.RecordCount; x=x+1) {
This_id = qGetEmails.Emails_id[x];
This_Subject = qGetEmails.Subject[x];
This_RecFrom = qGetEmails.RecFrom[x];
This_SentTo = qGetEmails.SentTo[x];
This_dReceived = qGetEmails.dReceived[x];
This_Body = qGetEmails.Body[x];
... // More code goes here.
}
</cfscript>
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:
Script functions
For a list of script functions, see “
Script Functions added in ColdFusion 9
” on page 109.
The CFScript language
The CFScript language syntax is similar to other scripting languages, and has the same types of elements.
Identifying CFScript
You enclose CFScript regions inside
<cfscript>
and
</cfscript>
tags. No other CFML tags are allowed inside a
cfscript
region. The following lines show a minimal script:
cfthread
thread
cfthrow
throw
cftrace
trace
cftransaction
transaction
cftry
try
break
do
import
var
case
else
in
while
catch
finally
interface
try
for
pageencoding
continue
function
return
default
if
switch
Tag
CFScript equivalent
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...