MACROMEDIA COLDFUSION 4.5 Reference

Category
Software
Type
Reference

This manual is also suitable for

Allaire Corporation
CFML Language
Reference
ColdFusion 4.5
Copyright Notice
© 1999 Allaire Corporation. All rights reserved.
This manual, as well as the software described in it, is furnished under license and may
be used or copied only in accordance with the terms of such license. The content of
this manual is furnished for informational use only, is subject to change without
notice, and should not be construed as a commitment by Allaire Corporation. Allaire
Corporation assumes no responsibility or liability for any errors or inaccuracies that
may appear in this book.
Except as permitted by such license, no part of this publication may be reproduced,
stored in a retrieval system, or transmitted in any form or by any means, electronic,
mechanical, recording, or otherwise, without the prior written permission of Allaire
Corporation.
ColdFusion and HomeSite are federally registered trademarks of Allaire Corporation.
HomeSite, the ColdFusion logo and the Allaire logo are trademarks of Allaire
Corporation in the USA and other countries. Microsoft, Windows, Windows NT,
Windows 95, Microsoft Access, and FoxPro are registered trademarks of Microsoft
Corporation. All other products or name brands are the trademarks of their respective
holders. Solaris is a trademark of Sun Microsystems Inc. UNIX is a trademark of The
Open Group. PostScript is a trademark of Adobe Systems Inc.
Part number: AA-45LNG-RK
Contents
Preface: Welcome To ColdFusion ................................................................xiii
Intended Audience.........................................................................................................................xiv
Welcome to the ColdFusion 4.5 Web Application Server ...........................................................xiv
Products and System Requirements ............................................................................................xiv
New features in ColdFusion 4.5.....................................................................................................xv
New visual tools......................................................................................................................xvi
Enhancements to CFML ........................................................................................................xvi
Better reliability ......................................................................................................................xvi
Improved performance.........................................................................................................xvii
Enterprise connectivity features ..........................................................................................xvii
Security enhancements....................................................................................................... xviii
Language Reference Features .......................................................................................................xix
Using Examples ......................................................................................................................xix
Using Code Snippets..............................................................................................................xix
Using End Tags................................................................................................................................xx
Developer Resources ......................................................................................................................xx
About ColdFusion Documentation ..............................................................................................xxi
Documentation updates........................................................................................................xxi
ColdFusion manuals ..............................................................................................................xxi
ColdFusion Server online documentation ..........................................................................xxii
Printing ColdFusion documentation...................................................................................xxii
Documentation conventions.............................................................................................. xxiii
Getting Answers .......................................................................................................................... xxiii
Contacting Allaire................................................................................................................ xxiii
Chapter 1: ColdFusion Tags.............................................................................1
Alphabetical List of ColdFusion Tags ............................................................................................. 2
New Tags in ColdFusion 4.5............................................................................................................ 5
ColdFusion Forms Tags................................................................................................................... 6
Database Manipulation Tags .......................................................................................................... 6
Data Output Tags ............................................................................................................................. 6
Exception Handling Tags ................................................................................................................ 6
Extensibility Tags ............................................................................................................................. 7
File Management Tags..................................................................................................................... 7
iv CFML Language Reference
Flow-Control Tags ............................................................................................................................7
Internet Protocol Tags......................................................................................................................7
Java Servlet and Java Object Tags....................................................................................................8
Variable Manipulation Tags.............................................................................................................8
Web Application Framework Tags ..................................................................................................8
Other Tags .........................................................................................................................................8
CFABORT...........................................................................................................................................9
CFAPPLET........................................................................................................................................11
CFAPPLICATION ............................................................................................................................13
CFASSOCIATE.................................................................................................................................16
CFAUTHENTICATE........................................................................................................................17
CFBREAK .........................................................................................................................................19
CFCACHE ........................................................................................................................................20
CFCOL..............................................................................................................................................23
CFCOLLECTION .............................................................................................................................25
CFCONTENT...................................................................................................................................28
CFCOOKIE.......................................................................................................................................30
CFDIRECTORY................................................................................................................................33
CFERROR.........................................................................................................................................36
CFERROR Error Variables.......................................................................................................37
CFEXECUTE ....................................................................................................................................40
CFEXIT.............................................................................................................................................42
CFFILE .............................................................................................................................................45
CFFILE ACTION attributes .....................................................................................................46
CFFILE ACTION="Upload"............................................................................................................47
Evaluating the results of a file upload....................................................................................49
CFFILE ACTION="Move"...............................................................................................................51
CFFILE ACTION="Rename" ..........................................................................................................52
CFFILE ACTION="Copy" ...............................................................................................................53
CFFILE ACTION="Delete" .............................................................................................................54
CFFILE ACTION="Read"................................................................................................................54
CFFILE ACTION="ReadBinary".....................................................................................................55
CFFILE ACTION="Write" ...............................................................................................................55
CFFILE ACTION="Append"...........................................................................................................58
CFFORM ..........................................................................................................................................59
Incorporating HTML form tags..............................................................................................60
CFFTP ..............................................................................................................................................63
Establishing a Connection with CFFTP.................................................................................63
File and Directory Operations with CFFTP...........................................................................66
CFFTP.ReturnValue Variable..................................................................................................70
Accessing the Columns in a Query Object ............................................................................70
Connection Caching ...............................................................................................................71
CFGRID............................................................................................................................................73
Select mode and form variables.............................................................................................78
Using SELECTMODE="Edit"..................................................................................................78
Using the HREF attribute........................................................................................................78
CFGRIDCOLUMN...........................................................................................................................81
CFGRIDROW...................................................................................................................................86
CFGRIDUPDATE.............................................................................................................................87
Contents v
CFHEADER......................................................................................................................................90
CFHTMLHEAD................................................................................................................................91
CFHTTP ...........................................................................................................................................92
CFHTTPPARAM ..............................................................................................................................98
CFIF/CFELSEIF/CFELSE..............................................................................................................100
CFIMPERSONATE.........................................................................................................................102
CFINCLUDE ..................................................................................................................................104
CFINDEX .......................................................................................................................................105
CFINPUT .......................................................................................................................................109
CFINSERT......................................................................................................................................112
CFLDAP..........................................................................................................................................115
CFLOCATION................................................................................................................................121
CFLOCK .........................................................................................................................................122
CFLOOP .........................................................................................................................................129
Index Loops............................................................................................................................129
Conditional Loops.................................................................................................................130
Looping over a Query............................................................................................................131
Looping over a List ................................................................................................................132
Looping over a COM Collection or Structure......................................................................133
CFMAIL..........................................................................................................................................135
CFMAILPARAM.............................................................................................................................138
CFMODULE ..................................................................................................................................140
CFOBJECT .....................................................................................................................................143
CFOBJECT TYPE attributes...................................................................................................143
CFOBJECT Type="COM" .............................................................................................................144
CFOBJECT Type="CORBA"..........................................................................................................146
CFOBJECT Type="JAVA"..............................................................................................................147
CFOUTPUT ...................................................................................................................................149
CFPARAM ......................................................................................................................................151
CFPOP............................................................................................................................................154
CFPROCESSINGDIRECTIVE........................................................................................................159
CFPROCPARAM............................................................................................................................160
CFPROCRESULT...........................................................................................................................163
CFQUERY ......................................................................................................................................165
CFQUERYPARAM .........................................................................................................................170
CFREGISTRY .................................................................................................................................174
CFREGISTRY ACTION attributes .........................................................................................174
CFREGISTRY ACTION="GetAll"..................................................................................................175
CFREGISTRY ACTION="Get".......................................................................................................176
CFREGISTRY ACTION="Set" .......................................................................................................177
CFREGISTRY ACTION="Delete" .................................................................................................178
CFREPORT.....................................................................................................................................180
CFRETHROW ................................................................................................................................182
CFSCRIPT ......................................................................................................................................184
CFSEARCH.....................................................................................................................................185
CFSELECT......................................................................................................................................189
CFSERVLET ...................................................................................................................................192
CFSERVLETPARAM ......................................................................................................................194
CFSET.............................................................................................................................................197
vi CFML Language Reference
Arrays......................................................................................................................................197
Dynamic variable names ......................................................................................................197
COM objects ..........................................................................................................................197
CFSETTING ...................................................................................................................................199
CFSILENT ......................................................................................................................................201
CFSLIDER ......................................................................................................................................202
CFSTOREDPROC ..........................................................................................................................207
CFSWITCH/CFCASE/CFDEFAULTCASE....................................................................................210
CFTABLE........................................................................................................................................212
CFTEXTINPUT ..............................................................................................................................214
CFTHROW.....................................................................................................................................218
CFTRANSACTION.........................................................................................................................220
CFTREE..........................................................................................................................................223
CFTREEITEM ................................................................................................................................228
CFTRY/CFCATCH.........................................................................................................................232
CFUPDATE....................................................................................................................................236
CFWDDX .......................................................................................................................................239
Chapter 2: ColdFusion Functions................................................................241
Alphabetical List of ColdFusion Functions.................................................................................242
New Functions in ColdFusion 4.5 ...............................................................................................245
Array Functions.............................................................................................................................245
Authentication Functions ............................................................................................................245
Date and Time Functions.............................................................................................................246
Decision Functions.......................................................................................................................246
Display and Formatting Functions..............................................................................................247
Dynamic Evaluation Functions ...................................................................................................247
International Functions ...............................................................................................................247
List Functions................................................................................................................................248
Mathematical Functions ..............................................................................................................248
Query Functions ...........................................................................................................................249
String Functions............................................................................................................................249
Structure Functions......................................................................................................................250
System Functions..........................................................................................................................250
Other Functions ............................................................................................................................250
Abs..................................................................................................................................................251
ACos ...............................................................................................................................................252
ArrayAppend .................................................................................................................................254
ArrayAvg.........................................................................................................................................255
ArrayClear......................................................................................................................................257
ArrayDeleteAt................................................................................................................................258
ArrayInsertAt.................................................................................................................................259
ArrayIsEmpty.................................................................................................................................260
ArrayLen ........................................................................................................................................261
ArrayMax .......................................................................................................................................262
ArrayMin........................................................................................................................................264
ArrayNew.......................................................................................................................................266
ArrayPrepend ................................................................................................................................267
Contents vii
ArrayResize....................................................................................................................................268
ArraySet..........................................................................................................................................269
ArraySort........................................................................................................................................270
ArraySum.......................................................................................................................................271
ArraySwap......................................................................................................................................273
ArrayToList ....................................................................................................................................274
Asc ..................................................................................................................................................275
ASin ................................................................................................................................................276
Atn..................................................................................................................................................278
AuthenticatedContext ..................................................................................................................279
AuthenticatedUser........................................................................................................................280
BitAnd ............................................................................................................................................281
BitMaskClear .................................................................................................................................282
BitMaskRead .................................................................................................................................283
BitMaskSet.....................................................................................................................................284
BitNot.............................................................................................................................................285
BitOr...............................................................................................................................................286
BitSHLN.........................................................................................................................................287
BitSHRN.........................................................................................................................................288
BitXor .............................................................................................................................................289
Ceiling............................................................................................................................................290
Chr..................................................................................................................................................291
CJustify...........................................................................................................................................292
Compare ........................................................................................................................................293
CompareNoCase...........................................................................................................................295
Cos..................................................................................................................................................296
CreateDate.....................................................................................................................................297
CreateDateTime............................................................................................................................299
CreateObject..................................................................................................................................301
Object Types ..........................................................................................................................301
COM...............................................................................................................................................301
CORBA ...........................................................................................................................................302
JAVA................................................................................................................................................303
CreateODBCDate..........................................................................................................................305
CreateODBCDateTime.................................................................................................................307
CreateODBCTime .........................................................................................................................309
CreateTime....................................................................................................................................311
CreateTimeSpan ...........................................................................................................................313
CreateUUID...................................................................................................................................314
DateAdd.........................................................................................................................................315
DateCompare................................................................................................................................317
DateConvert ..................................................................................................................................320
DateDiff .........................................................................................................................................323
DateFormat ...................................................................................................................................325
DatePart.........................................................................................................................................327
Day .................................................................................................................................................329
DayOfWeek....................................................................................................................................330
DayOfWeekAsString .....................................................................................................................331
DayOfYear......................................................................................................................................332
viii CFML Language Reference
DaysInMonth ................................................................................................................................333
DaysInYear ....................................................................................................................................334
DE...................................................................................................................................................335
DecimalFormat .............................................................................................................................336
DecrementValue ...........................................................................................................................337
Decrypt ..........................................................................................................................................338
DeleteClientVariable ....................................................................................................................339
DirectoryExists ..............................................................................................................................340
DollarFormat.................................................................................................................................341
Encrypt...........................................................................................................................................342
Evaluate .........................................................................................................................................343
Exp..................................................................................................................................................344
ExpandPath ...................................................................................................................................345
FileExists........................................................................................................................................346
Find ................................................................................................................................................347
FindNoCase...................................................................................................................................348
FindOneOf.....................................................................................................................................349
FirstDayOfMonth..........................................................................................................................350
Fix...................................................................................................................................................351
FormatBaseN.................................................................................................................................352
GetBaseTagData............................................................................................................................353
GetBaseTagList..............................................................................................................................354
GetBaseTemplatePath..................................................................................................................355
GetClientVariablesList..................................................................................................................356
GetCurrentTemplatePath.............................................................................................................357
GetDirectoryFromPath.................................................................................................................358
GetFileFromPath...........................................................................................................................359
GetFunctionList ............................................................................................................................360
GetLocale.......................................................................................................................................361
GetMetricData...............................................................................................................................363
GetProfileString.............................................................................................................................365
GetTempDirectory........................................................................................................................367
GetTempFile..................................................................................................................................368
GetTemplatePath..........................................................................................................................369
GetTickCount ................................................................................................................................370
GetTimeZoneInfo .........................................................................................................................371
GetToken .......................................................................................................................................372
Hour ...............................................................................................................................................373
HTMLCodeFormat .......................................................................................................................374
HTMLEditFormat .........................................................................................................................376
IIf ....................................................................................................................................................378
IncrementValue ............................................................................................................................381
InputBaseN....................................................................................................................................382
Insert..............................................................................................................................................383
Int ...................................................................................................................................................384
IsArray............................................................................................................................................385
IsAuthenticated.............................................................................................................................386
IsAuthorized ..................................................................................................................................387
IsBinary..........................................................................................................................................390
Contents ix
IsBoolean.......................................................................................................................................391
IsDate.............................................................................................................................................392
IsDebugMode................................................................................................................................393
IsDefined .......................................................................................................................................394
IsLeapYear .....................................................................................................................................395
IsNumeric......................................................................................................................................396
IsNumericDate..............................................................................................................................397
IsProtected.....................................................................................................................................398
IsQuery...........................................................................................................................................401
IsSimpleValue................................................................................................................................402
IsStruct...........................................................................................................................................403
JSStringFormat..............................................................................................................................404
LCase..............................................................................................................................................405
Left .................................................................................................................................................406
Len..................................................................................................................................................407
ListAppend ....................................................................................................................................408
ListChangeDelims.........................................................................................................................409
ListContains ..................................................................................................................................410
ListContainsNoCase .....................................................................................................................412
ListDeleteAt ...................................................................................................................................413
ListFind..........................................................................................................................................414
ListFindNoCase.............................................................................................................................416
ListFirst ..........................................................................................................................................417
ListGetAt ........................................................................................................................................418
ListInsertAt ....................................................................................................................................419
ListLast...........................................................................................................................................420
ListLen ...........................................................................................................................................421
ListPrepend ...................................................................................................................................422
ListQualify .....................................................................................................................................423
ListRest...........................................................................................................................................425
ListSetAt.........................................................................................................................................426
ListSort...........................................................................................................................................428
ListToArray ....................................................................................................................................430
ListValueCount..............................................................................................................................431
ListValueCountNoCase ................................................................................................................433
LJustify ...........................................................................................................................................435
Log..................................................................................................................................................436
Log10..............................................................................................................................................437
LSCurrencyFormat .......................................................................................................................438
LSDateFormat ...............................................................................................................................441
LSEuroCurrencyFormat ...............................................................................................................443
LSIsCurrency.................................................................................................................................447
LSIsDate.........................................................................................................................................448
LSIsNumeric..................................................................................................................................449
LSNumberFormat.........................................................................................................................450
LSParseCurrency...........................................................................................................................453
Currency output ....................................................................................................................453
LSParseDateTime..........................................................................................................................456
LSParseEuroCurrency ..................................................................................................................458
x CFML Language Reference
LSParseNumber ............................................................................................................................460
LSTimeFormat ..............................................................................................................................461
LTrim..............................................................................................................................................463
Max.................................................................................................................................................464
Mid .................................................................................................................................................465
Min.................................................................................................................................................466
Minute............................................................................................................................................467
Month ............................................................................................................................................468
MonthAsString ..............................................................................................................................469
Now................................................................................................................................................470
NumberFormat.............................................................................................................................471
ParagraphFormat..........................................................................................................................474
ParameterExists ............................................................................................................................475
ParseDateTime..............................................................................................................................476
Pi.....................................................................................................................................................478
PreserveSingleQuotes...................................................................................................................479
Quarter...........................................................................................................................................480
QueryAddColumn.........................................................................................................................481
QueryAddRow ...............................................................................................................................483
QueryNew......................................................................................................................................484
QuerySetCell..................................................................................................................................485
QuotedValueList ...........................................................................................................................487
Rand...............................................................................................................................................488
Randomize.....................................................................................................................................489
RandRange ....................................................................................................................................490
REFind ...........................................................................................................................................491
REFindNoCase ..............................................................................................................................494
RemoveChars ................................................................................................................................497
RepeatString..................................................................................................................................498
Replace...........................................................................................................................................499
ReplaceList ....................................................................................................................................500
ReplaceNoCase .............................................................................................................................502
REReplace......................................................................................................................................503
REReplaceNoCase.........................................................................................................................504
Reverse...........................................................................................................................................505
Right...............................................................................................................................................506
RJustify...........................................................................................................................................507
Round.............................................................................................................................................508
RTrim .............................................................................................................................................509
Second ...........................................................................................................................................510
SetLocale........................................................................................................................................511
Locale support.......................................................................................................................511
SetProfileString .............................................................................................................................513
SetVariable.....................................................................................................................................515
Sgn..................................................................................................................................................516
Sin...................................................................................................................................................517
SpanExcluding ..............................................................................................................................518
SpanIncluding...............................................................................................................................519
Sqr ..................................................................................................................................................520
Contents xi
StripCR...........................................................................................................................................521
StructClear.....................................................................................................................................522
StructCopy.....................................................................................................................................523
StructCount ...................................................................................................................................524
StructDelete...................................................................................................................................525
StructFind......................................................................................................................................527
StructInsert....................................................................................................................................528
StructIsEmpty................................................................................................................................530
StructKeyArray ..............................................................................................................................531
StructKeyExists..............................................................................................................................534
StructKeyList .................................................................................................................................535
StructNew......................................................................................................................................538
StructUpdate.................................................................................................................................539
Tan .................................................................................................................................................540
TimeFormat...................................................................................................................................541
ToBase64........................................................................................................................................543
ToBinary ........................................................................................................................................545
ToString .........................................................................................................................................547
Trim................................................................................................................................................549
UCase.............................................................................................................................................550
URLDecode ...................................................................................................................................551
URLEncodedFormat.....................................................................................................................552
Val...................................................................................................................................................553
ValueList ........................................................................................................................................554
Week...............................................................................................................................................555
WriteOutput ..................................................................................................................................556
XMLFormat ...................................................................................................................................557
Year ................................................................................................................................................558
YesNoFormat.................................................................................................................................559
Chapter 3: WDDX JavaScript Objects .........................................................561
WddxSerializer Object ..................................................................................................................562
serialize ..................................................................................................................................562
serializeVariable ....................................................................................................................562
serializeValue.........................................................................................................................563
write........................................................................................................................................564
WddxRecordset Object.................................................................................................................565
addColumn............................................................................................................................565
addRows.................................................................................................................................566
getField...................................................................................................................................566
getRowCount .........................................................................................................................567
setField...................................................................................................................................568
wddxSerialize.........................................................................................................................568
Chapter 4: ColdFusion Expressions: Operators and Other Constructs....571
Elements of ColdFusion Expressions..........................................................................................572
Notes on date-and-time values............................................................................................574
xii CFML Language Reference
Notes on using variables.......................................................................................................575
Operators.......................................................................................................................................576
Arithmetic operators.............................................................................................................576
String operators.....................................................................................................................577
Decision, or comparison, operators ....................................................................................577
Boolean operators.................................................................................................................579
Operator Precedence....................................................................................................................579
Function Syntax ............................................................................................................................580
Optional arguments in functions.........................................................................................580
Pound Signs...................................................................................................................................581
Pound signs inside CFOUTPUT tags ...................................................................................581
Pound signs inside strings ....................................................................................................582
Pound signs inside tag attribute values...............................................................................583
Nested pound signs...............................................................................................................583
Pound signs in general expressions.....................................................................................584
Preface Welcome To ColdFusion
ColdFusion is a rapid application development system for professional developers
who want to create dynamic Web applications and interactive Web sites. It provides
the fastest way to integrate browser, server, and database technologies into powerful
Web applications. With ColdFusion, you can build everything from online stores to
sophisticated business systems.
Developing applications with ColdFusion does not require coding in a traditional
programming language; instead, you build applications by combining standard
HTML with a straightforward server-side markup language, the ColdFusion Markup
Language (CFML). This manual documents CFML.
Contents
• Intended Audience.......................................................................................... xiv
• Welcome to the ColdFusion 4.5 Web Application Server............................. xiv
• Products and System Requirements.............................................................. xiv
• New features in ColdFusion 4.5 ...................................................................... xv
• Language Reference Features......................................................................... xix
• Using End Tags ..................................................................................................xx
• Developer Resources.........................................................................................xx
• About ColdFusion Documentation ............................................................... xxi
• Getting Answers ............................................................................................ xxiii
xiv CFML Language Reference
Intended Audience
This reference is intended for web developers who have a working knowledge of
ColdFusion; that is, you know how to use tags and functions, but you need a
comprehensive reference that provides an in-depth description of each tag and
function, and examples of how tags and functions are used in the context of an HTML/
CFML page.
Welcome to the ColdFusion 4.5 Web Application Server
The ColdFusion 4.5 release focuses on fundamentals — the fundamentals of delivering
your e-business: faster development, better reliability, enhanced scalability, expanded
integration, and stronger security.
At the center of the ColdFusion 4.5 release is an application server platform that's been
highly optimized with new functionality and native support for UNIX. As a result, your
e-business systems will run better and do more. With this release we're launching a
new edition of ColdFusion Server for Linux so you can take advantage of the reliability
and performance of the hottest new Internet server operating system.
While optimizing the core server, we also enhanced fundamental features including
email integration, server-side FTP and HTTP, advanced security, scheduling, and
database connectivity — again giving you more reliability and new functionality.
The focus on fundamentals extends to new features. As part of a broad new
commitment to Java, ColdFusion 4.5 has a range of new Java integration options from
Java CFXs to Java Servlet support to Java object and EJB connectivity. In ColdFusion
Studio 4.5, we added new tools to make you more productive including a flexible new
project architecture that makes managing and deploying complex Web applications a
snap. On the server, we focused on reliability, performance and security with features
such as service-level fail-over, Cisco Local Director integration, and OS security
integration.
Whether you're revolutionizing your company's HR operations, building the next
generation of your firm's global intranet, or launching the next killer .COM company,
you'll find the speed, scalability, connectivity, and security you need in ColdFusion 4.5.
Products and System Requirements
ColdFusion has been fully tested on the following platforms and with the following
configurations.
ColdFusion Server 4.5 Enterprise Edition for Windows
• Windows NT 4.0 SP4+
• Intel Pentium or above
• 150 MB hard disk space
Preface xv
• 128 MB RAM (256 MB recommended for clustering)
ColdFusion Server 4.5 Enterprise Edition for Solaris
• SPARC Solaris 2.5.1, 2.6, or 7 (patch 103582-1B or higher)
• 128 MB RAM (256 MB recommended for clustering)
• 200 MB hard disk space
ColdFusion Server 4.5 Enterprise Edition for Linux
• Red Hat Linux 6.0 or 6.1
• Intel Pentium or above
• 128 MB RAM (256 MB recommended for clustering)
• 150 MB hard disk space
ColdFusion Server 4.5 Professional Edition for Windows
• Windows 95/98 or Windows NT 4.0
• Intel Pentium or above
• 50 MB hard disk space
• 32 MB RAM (128 MB recommended)
ColdFusion Server 4.5 Professional Edition for Linux
• Red Hat Linux 6.0 or 6.1
• Intel Pentium or above
• 64 MB RAM (128 MB recommended)
• 100 MB hard disk space
ColdFusion Studio 4.5
• Windows 95/98/NT4
• Intel Pentium or above
• 35 MB hard disk space
• 32 MB RAM (64 MB recommended)
New features in ColdFusion 4.5
A wide range of new features are available in ColdFusion 4.5.
xvi CFML Language Reference
New visual tools
Universal File Browser — Access all your files from a single explorer that integrates
access to the Windows file system, ColdFusion RDS servers, and FTP servers. Drag-
and-drop between any of these services all in an integrated file browser.
Advanced Project Management — Manage your complex Web application
development projects with a new project architecture that gives you more flexibility
and control using physical, virtual, and auto-inclusive project folders as well as project
resource browsing.
Scriptable Deployment — Deploy applications to complex server configurations with
FTP or ColdFusion Remote Development Services (RDS). Use VBScript or Java Script to
fully script deployment of projects with granular control over how files uploaded.
Setup deployment scripts using a powerful wizard and save scripts for re-use.
Collapsible Code — Work with large, complex scripts and pages more easily by
collapsing sections of the code in the editor so you can build sophisticated
applications more quickly.
Function Insight — Find the parameters and format for functions instantly and inline
as you code.
Image Map Editor — Create image maps right in ColdFusion Studio with a new easy-
to-use visual tool.
Configuration Wizard — Setup your work environment so it meets all your needs
using any of more than dozen common configurations.
TopStyle CSS Editor — Create and edit standards-compliant cascading style sheets to
easily control the look and feel of your web applications.
WML Support — Build wireless Web applications quickly and easily with the complete
set of Wireless Markup Language (WML) visual tools.
Enhancements to CFML
Object Scripting — Instantiate and script objects using CFML script in addition to the
CFOBJECT tag easier integration with distributed object middleware such as COM and
CORBA.
Structured Exception Handling — Exception handling now offers hierarchical
exception handling that supports both greater customization and greater access to
internal exceptions.
String Conversion Functions — Convert strings quickly and easily to be compatible
with Java Script and XML standards.
Better reliability
Server Probes — Guarantee high availability by automatically detecting when a
ColdFusion Server or Web server hangs or stops, failing-over to a new machine in a
ColdFusion cluster, and restarting the server with problems. (Enterprise Edition only)
Preface xvii
Improved Automatic Server Recovery — Monitor and automatically restart server
process in case of failures or critical errors on individual servers not deployed in a
cluster.
Clustering Support for Apache — Setup ColdFusion clusters on Linux and Solaris
using the Apache Web Server. (Enterprise Edition only)
Automatic Shared Variable Locking — Lock user and session variable reads
automatically at the server level to prevent destabilizing conflicts and control thread
write contentions. Configure variable locking to meet the specific needs of your
applications.
Individual Data Source Control — Enable and disable individual data sources
individually without affecting server availability for runtime data source maintenance
without server restarts.
Improved performance
Cisco Local Director Integration — Deliver very large scale sites with Cisco Local
Director intelligently balancing load based on the load metrics provided by the
ColdFusion Servers in a cluster. (Enterprise Edition only)
Client-Side Page Caching — Leverage browser page caching to avoid unnecessary
downloads of unchanged pages and improve overall site performance.
Programmatically control refresh of client-side cache to ensure users see most up-to-
date output.
White Space Removal — Reduce white space left by processed code in application
pages to make the pages smaller and faster. Control white space removal
programmatically or administratively.
Scriptable Performance Metrics — Track key server metrics at run time through your
own scripts for intelligent diagnosis of performance bottlenecks of stability problems
in your applications.
Performance Debugging Data — Access detailed debugging information on the
performance of each individual page included in an application page that is being
debugged.
Enterprise connectivity features
Transaction Commit and Rollback — Control database transactions with
programmable commit and rollback support for more reliable and better-managed
database interactions.
Java Object and EJB Connectivity — Connect to any Java object or Enterprise JavaBean
(EJB) hosted by any major EJB server to extend ColdFusion and access complex
business logic or third party distributed components.
Java Servlets — Call Java Servlets hosted by a Servlet Engine such as Allaire JRun from
within a ColdFusion application to access extended functionality
xviii CFML Language Reference
Java-based ColdFusion Extensions (CFX) — Extend ColdFusion with new
functionality through CFXs created with Java.
Binary Object Support — Use Character Large Binary Object (CLOB) support to
encoded binary objects, transmit them via XML, and store them in databases or files.
SQL Bind Parameters — Improve query performance, security and flexibility with
explicitly typed query parameters.
WDDX 1.0 — Exchange complex data, including encoded images, between servers and
with other programming environments even faster using the latest version of Web
Distributed Data Exchange (WDDX).
OS Command Execution — Execute OS shell scripts, services, executables and batch
files from within ColdFusion applications.
LDAP 3.0 — Use all the power of LDAP 3.0 for directory access including file filtering,
SSL encryption, and Microsoft Active Directory integration.
Enhanced Mail Integration — Develop more sophisticated and robust email
applications with new support for controlling mail headers, BCC, and multiple file
attachments.
Improved Server-Side HTTP — Use URL redirection, SSL, cookies, return headers, and
more robust server-side HTTP support for building distributed Web applications.
Security enhancements
General OS Security Integration — Secure entire Web applications and control access
to files and objects through your existing Windows NT security architecture.
Authenticated users in your applications can be limited to privileges authorized
through Windows security. (Windows NT Only)
OS Server Sandbox Security — Secure shared hosting environments more easily by
creating Server Sandboxes with Windows NT security. OS Server Sandboxes process all
requests under the privileges of a designated Windows NT user account (Enterprise
Edition for Windows only).
Enhanced Advanced Security — Secure CFML functions and enable CFML code
segments to be executed using the run-time security permissions of a designated user.
New Advanced Security Interface — Manage Advanced Security configuration more
quickly and easily with a completely redesigned browser-based resource view.
Scriptable Advanced Security Administration — Configure ColdFusion Advanced
Security through your own CFML scripts for easier maintenance of ColdFusion
Servers.
Preface xix
Language Reference Features
The CFML Language Reference provides descriptions, syntax, usage, and code
examples for:
• CFML Tags
• CFML Functions
• JavaScript objects used when implementing web distributed data exchange
(WDDX)
The CFML Language Reference also provides a chapter on expressions, operators, and
other CFML constructs.
Using Examples
Each tag and function features a runnable example, using code drawn from the
snippets directory (found in webroot\cfdocs\snippets). The display and usage for these
examples differs depending on the delivery mechanism:
• Printed and PDF documentation — Whenever possible, the printed
documentation displays a complete example. In some cases, extraneous code
has been removed to maintain clarity and to conserve space.
• HTML documentation — Each tag or function displays an examples button
that you click to execute that element. The online example displays two frames:
one that runs the example, and one that displays the associated code. In some
cases, code examples are view-only due to logistic, administrative, or security
reasons.
The examples button uses a relative reference to access the page that runs the
code snippet. Snippets will not run if files have been moved or if ColdFusion
Server is not running.
When running examples using ColdFusion Studio on a workstation that isn’t
running ColdFusion Server, you will need to specify the ColdFusion Server
location using the Browse tab on the Settings dialog box.
Using Code Snippets
The snippets directory contains example code for every CFML tag and function. You
can browse this directory to find examples of CFML tag and function usage in many
different contexts.
xx CFML Language Reference
Using End Tags
Except where noted in the syntax, CFML tags do not require an end tag. However, all
CFML tags (except CFELSE and CFELSEIF) can accept an optional end tag, as follows:
• Shorthand — You can use shorthand notation to include the end tag with the
base tag. For example:
<CFABORT/>
• Explicit specification — You can specify an end tag explicitly. However, there
can be no white space between the start and end tags. For example:
<CFABORT></CFABORT>
<!--- The following will produce a validation error
<CFABORT>
</CFABORT> --->
You do not typically code optional end tags.
Developer Resources
Allaire Corporation is committed to setting the standard for customer support in
developer education, technical support, and professional services. Our Web site is
designed to give you quick access to the entire range of online resources.
Allaire Developer Services
Resource Description
Allaire Web site
www.allaire.com
General information about Allaire products and
services.
Technical Support
www.allaire.com/support
Allaire offers a wide range of professional support
programs. This page explains all of the available
options.
Training and Consulting
www.allaire.com/services
Information about training classes, online
courses, and consulting services offered by
Allaire.
Developer Community
www.allaire.com/developer
All of the resources you need to stay on the
cutting edge of ColdFusion development,
including online discussion groups, Knowledge
Base, Component Exchange, Resource Library,
technical papers and more.
Allaire Partners
www.allaire.com/partners
The Allaire Alliance is a network of solution
providers, application developers, resellers, and
hosting services creating solutions with
ColdFusion.
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78
  • Page 79 79
  • Page 80 80
  • Page 81 81
  • Page 82 82
  • Page 83 83
  • Page 84 84
  • Page 85 85
  • Page 86 86
  • Page 87 87
  • Page 88 88
  • Page 89 89
  • Page 90 90
  • Page 91 91
  • Page 92 92
  • Page 93 93
  • Page 94 94
  • Page 95 95
  • Page 96 96
  • Page 97 97
  • Page 98 98
  • Page 99 99
  • Page 100 100
  • Page 101 101
  • Page 102 102
  • Page 103 103
  • Page 104 104
  • Page 105 105
  • Page 106 106
  • Page 107 107
  • Page 108 108
  • Page 109 109
  • Page 110 110
  • Page 111 111
  • Page 112 112
  • Page 113 113
  • Page 114 114
  • Page 115 115
  • Page 116 116
  • Page 117 117
  • Page 118 118
  • Page 119 119
  • Page 120 120
  • Page 121 121
  • Page 122 122
  • Page 123 123
  • Page 124 124
  • Page 125 125
  • Page 126 126
  • Page 127 127
  • Page 128 128
  • Page 129 129
  • Page 130 130
  • Page 131 131
  • Page 132 132
  • Page 133 133
  • Page 134 134
  • Page 135 135
  • Page 136 136
  • Page 137 137
  • Page 138 138
  • Page 139 139
  • Page 140 140
  • Page 141 141
  • Page 142 142
  • Page 143 143
  • Page 144 144
  • Page 145 145
  • Page 146 146
  • Page 147 147
  • Page 148 148
  • Page 149 149
  • Page 150 150
  • Page 151 151
  • Page 152 152
  • Page 153 153
  • Page 154 154
  • Page 155 155
  • Page 156 156
  • Page 157 157
  • Page 158 158
  • Page 159 159
  • Page 160 160
  • Page 161 161
  • Page 162 162
  • Page 163 163
  • Page 164 164
  • Page 165 165
  • Page 166 166
  • Page 167 167
  • Page 168 168
  • Page 169 169
  • Page 170 170
  • Page 171 171
  • Page 172 172
  • Page 173 173
  • Page 174 174
  • Page 175 175
  • Page 176 176
  • Page 177 177
  • Page 178 178
  • Page 179 179
  • Page 180 180
  • Page 181 181
  • Page 182 182
  • Page 183 183
  • Page 184 184
  • Page 185 185
  • Page 186 186
  • Page 187 187
  • Page 188 188
  • Page 189 189
  • Page 190 190
  • Page 191 191
  • Page 192 192
  • Page 193 193
  • Page 194 194
  • Page 195 195
  • Page 196 196
  • Page 197 197
  • Page 198 198
  • Page 199 199
  • Page 200 200
  • Page 201 201
  • Page 202 202
  • Page 203 203
  • Page 204 204
  • Page 205 205
  • Page 206 206
  • Page 207 207
  • Page 208 208
  • Page 209 209
  • Page 210 210
  • Page 211 211
  • Page 212 212
  • Page 213 213
  • Page 214 214
  • Page 215 215
  • Page 216 216
  • Page 217 217
  • Page 218 218
  • Page 219 219
  • Page 220 220
  • Page 221 221
  • Page 222 222
  • Page 223 223
  • Page 224 224
  • Page 225 225
  • Page 226 226
  • Page 227 227
  • Page 228 228
  • Page 229 229
  • Page 230 230
  • Page 231 231
  • Page 232 232
  • Page 233 233
  • Page 234 234
  • Page 235 235
  • Page 236 236
  • Page 237 237
  • Page 238 238
  • Page 239 239
  • Page 240 240
  • Page 241 241
  • Page 242 242
  • Page 243 243
  • Page 244 244
  • Page 245 245
  • Page 246 246
  • Page 247 247
  • Page 248 248
  • Page 249 249
  • Page 250 250
  • Page 251 251
  • Page 252 252
  • Page 253 253
  • Page 254 254
  • Page 255 255
  • Page 256 256
  • Page 257 257
  • Page 258 258
  • Page 259 259
  • Page 260 260
  • Page 261 261
  • Page 262 262
  • Page 263 263
  • Page 264 264
  • Page 265 265
  • Page 266 266
  • Page 267 267
  • Page 268 268
  • Page 269 269
  • Page 270 270
  • Page 271 271
  • Page 272 272
  • Page 273 273
  • Page 274 274
  • Page 275 275
  • Page 276 276
  • Page 277 277
  • Page 278 278
  • Page 279 279
  • Page 280 280
  • Page 281 281
  • Page 282 282
  • Page 283 283
  • Page 284 284
  • Page 285 285
  • Page 286 286
  • Page 287 287
  • Page 288 288
  • Page 289 289
  • Page 290 290
  • Page 291 291
  • Page 292 292
  • Page 293 293
  • Page 294 294
  • Page 295 295
  • Page 296 296
  • Page 297 297
  • Page 298 298
  • Page 299 299
  • Page 300 300
  • Page 301 301
  • Page 302 302
  • Page 303 303
  • Page 304 304
  • Page 305 305
  • Page 306 306
  • Page 307 307
  • Page 308 308
  • Page 309 309
  • Page 310 310
  • Page 311 311
  • Page 312 312
  • Page 313 313
  • Page 314 314
  • Page 315 315
  • Page 316 316
  • Page 317 317
  • Page 318 318
  • Page 319 319
  • Page 320 320
  • Page 321 321
  • Page 322 322
  • Page 323 323
  • Page 324 324
  • Page 325 325
  • Page 326 326
  • Page 327 327
  • Page 328 328
  • Page 329 329
  • Page 330 330
  • Page 331 331
  • Page 332 332
  • Page 333 333
  • Page 334 334
  • Page 335 335
  • Page 336 336
  • Page 337 337
  • Page 338 338
  • Page 339 339
  • Page 340 340
  • Page 341 341
  • Page 342 342
  • Page 343 343
  • Page 344 344
  • Page 345 345
  • Page 346 346
  • Page 347 347
  • Page 348 348
  • Page 349 349
  • Page 350 350
  • Page 351 351
  • Page 352 352
  • Page 353 353
  • Page 354 354
  • Page 355 355
  • Page 356 356
  • Page 357 357
  • Page 358 358
  • Page 359 359
  • Page 360 360
  • Page 361 361
  • Page 362 362
  • Page 363 363
  • Page 364 364
  • Page 365 365
  • Page 366 366
  • Page 367 367
  • Page 368 368
  • Page 369 369
  • Page 370 370
  • Page 371 371
  • Page 372 372
  • Page 373 373
  • Page 374 374
  • Page 375 375
  • Page 376 376
  • Page 377 377
  • Page 378 378
  • Page 379 379
  • Page 380 380
  • Page 381 381
  • Page 382 382
  • Page 383 383
  • Page 384 384
  • Page 385 385
  • Page 386 386
  • Page 387 387
  • Page 388 388
  • Page 389 389
  • Page 390 390
  • Page 391 391
  • Page 392 392
  • Page 393 393
  • Page 394 394
  • Page 395 395
  • Page 396 396
  • Page 397 397
  • Page 398 398
  • Page 399 399
  • Page 400 400
  • Page 401 401
  • Page 402 402
  • Page 403 403
  • Page 404 404
  • Page 405 405
  • Page 406 406
  • Page 407 407
  • Page 408 408
  • Page 409 409
  • Page 410 410
  • Page 411 411
  • Page 412 412
  • Page 413 413
  • Page 414 414
  • Page 415 415
  • Page 416 416
  • Page 417 417
  • Page 418 418
  • Page 419 419
  • Page 420 420
  • Page 421 421
  • Page 422 422
  • Page 423 423
  • Page 424 424
  • Page 425 425
  • Page 426 426
  • Page 427 427
  • Page 428 428
  • Page 429 429
  • Page 430 430
  • Page 431 431
  • Page 432 432
  • Page 433 433
  • Page 434 434
  • Page 435 435
  • Page 436 436
  • Page 437 437
  • Page 438 438
  • Page 439 439
  • Page 440 440
  • Page 441 441
  • Page 442 442
  • Page 443 443
  • Page 444 444
  • Page 445 445
  • Page 446 446
  • Page 447 447
  • Page 448 448
  • Page 449 449
  • Page 450 450
  • Page 451 451
  • Page 452 452
  • Page 453 453
  • Page 454 454
  • Page 455 455
  • Page 456 456
  • Page 457 457
  • Page 458 458
  • Page 459 459
  • Page 460 460
  • Page 461 461
  • Page 462 462
  • Page 463 463
  • Page 464 464
  • Page 465 465
  • Page 466 466
  • Page 467 467
  • Page 468 468
  • Page 469 469
  • Page 470 470
  • Page 471 471
  • Page 472 472
  • Page 473 473
  • Page 474 474
  • Page 475 475
  • Page 476 476
  • Page 477 477
  • Page 478 478
  • Page 479 479
  • Page 480 480
  • Page 481 481
  • Page 482 482
  • Page 483 483
  • Page 484 484
  • Page 485 485
  • Page 486 486
  • Page 487 487
  • Page 488 488
  • Page 489 489
  • Page 490 490
  • Page 491 491
  • Page 492 492
  • Page 493 493
  • Page 494 494
  • Page 495 495
  • Page 496 496
  • Page 497 497
  • Page 498 498
  • Page 499 499
  • Page 500 500
  • Page 501 501
  • Page 502 502
  • Page 503 503
  • Page 504 504
  • Page 505 505
  • Page 506 506
  • Page 507 507
  • Page 508 508
  • Page 509 509
  • Page 510 510
  • Page 511 511
  • Page 512 512
  • Page 513 513
  • Page 514 514
  • Page 515 515
  • Page 516 516
  • Page 517 517
  • Page 518 518
  • Page 519 519
  • Page 520 520
  • Page 521 521
  • Page 522 522
  • Page 523 523
  • Page 524 524
  • Page 525 525
  • Page 526 526
  • Page 527 527
  • Page 528 528
  • Page 529 529
  • Page 530 530
  • Page 531 531
  • Page 532 532
  • Page 533 533
  • Page 534 534
  • Page 535 535
  • Page 536 536
  • Page 537 537
  • Page 538 538
  • Page 539 539
  • Page 540 540
  • Page 541 541
  • Page 542 542
  • Page 543 543
  • Page 544 544
  • Page 545 545
  • Page 546 546
  • Page 547 547
  • Page 548 548
  • Page 549 549
  • Page 550 550
  • Page 551 551
  • Page 552 552
  • Page 553 553
  • Page 554 554
  • Page 555 555
  • Page 556 556
  • Page 557 557
  • Page 558 558
  • Page 559 559
  • Page 560 560
  • Page 561 561
  • Page 562 562
  • Page 563 563
  • Page 564 564
  • Page 565 565
  • Page 566 566
  • Page 567 567
  • Page 568 568
  • Page 569 569
  • Page 570 570
  • Page 571 571
  • Page 572 572
  • Page 573 573
  • Page 574 574
  • Page 575 575
  • Page 576 576
  • Page 577 577
  • Page 578 578
  • Page 579 579
  • Page 580 580
  • Page 581 581
  • Page 582 582
  • Page 583 583
  • Page 584 584
  • Page 585 585
  • Page 586 586
  • Page 587 587
  • Page 588 588
  • Page 589 589
  • Page 590 590
  • Page 591 591
  • Page 592 592
  • Page 593 593
  • Page 594 594
  • Page 595 595
  • Page 596 596
  • Page 597 597
  • Page 598 598
  • Page 599 599
  • Page 600 600
  • Page 601 601
  • Page 602 602
  • Page 603 603
  • Page 604 604
  • Page 605 605
  • Page 606 606
  • Page 607 607
  • Page 608 608

MACROMEDIA COLDFUSION 4.5 Reference

Category
Software
Type
Reference
This manual is also suitable for

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI