Quick Reference to CFML © 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.
Contents CFML Tags ............................................................. 1 CFML Functions .................................................. 12 Array functions .....................................................................12 Date and time functions ...................................................12 Decision functions ...............................................................13 Display and formatting functions ..................................13 Dynamic evaluation functions .........
Standard CGI Variables ......................................25 Request ................................................................................... 25 Server ...................................................................................... 25 Client ....................................................................................... 25 ColdFusion Studio Keyboard Shortcuts ...........26 File and Document Keyboard Shortcuts .................... 26 Debugger Keyboard Shortcuts .................
CFML Tags CFABORT CFAPPLET CFAPPLICATION
CFDIRECTORY CFERROR CFEXECUTE CFEXIT
PORT="port" CONNECTION="name" PROXYSERVER="proxyserver" PROXYBYPASS="proxybypass" RETRYCOUNT="number" STOPONERROR="Yes" or "No" PASSIVE="Yes" or "No"> or
FONT="column_font" FONTSIZE="size" ITALIC="Yes" or "No" BOLD="Yes" or "No" HREF="URL" HREFKEY="column_name" TARGET="URL_target" SELECT="Yes" or "No" DISPLAY="Yes" or "No" TYPE="type" HEADERFONT"font_name" HEADERFONTSIZE="size" HEADERITALIC="Yes" or "No" HEADERBOLD="Yes" or "No" DATAALIGN="position" HEADERALIGN="position" NUMBERFORMAT="format"> CFGRIDROW PAGE 8CFIMPERSONATE ... HTML or CFML code to execute ...
CFLOCATION CFLOCK CFLOOP ... HTML or CFML code to execute ...
CFOBJECT or or CFOUTPUT CFPARAM PAGE 11CFQUERY SQL statements CFQUERYPARAM
CFSEARCH CFSELECT CFSERVLET
GROOVECOLOR="color" BGCOLOR="color" TEXTCOLOR="color" FONT="font_name" FONTSIZE="integer" ITALIC="Yes" or "No" BOLD="Yes" or "No" NOTSUPPORTED="text"> CFSTOREDPROC CFSWITCH CFCASE CFDEFAULTCASE
CFTREE CFTREEITEM
CFML Functions Array functions ArrayAppend(array, value) ArrayAvg(array) ArrayClear(array) ArrayDeleteAt(array, position) ArrayInsertAt(array, position, value) ArrayIsEmpty(array) ArrayLen(array) ArrayMax(array) ArrayMin(array) ArrayNew(dimension) ArrayPrepend(array, value) ArrayResize(array, minimum_size) ArraySet(array, start_pos, end_pos, value) ArraySort(array, sort_type [, sort_order ]) ArraySum(array) ArraySwap(array, position1, position2) ArrayToList(array [, delimiter ]) IsArray(value [, number ]) L
Decision functions IsArray(value [, number ]) IsAuthenticated([security-context-name ]) IsAuthorized(resourcetype, resourcename [, action ]) IsBinary(value) IsBoolean(value) IsDate(string) IsDebugMode() IsDefined("variable_name") IsLeapYear(year) IsNumeric(string) IsNumericDate(number) IsQuery(value) IsSimpleValue(value) IsStruct(variable ) LSIsCurrency(string) LSIsDate(string) LSIsNumeric(string) Display and formatting functions DateFormat(date [, mask ]) DecimalFormat(number) DollarFormat(number) FormatB
List functions ArrayToList(array [, delimiter ]) ListAppend(list, value [, delimiters ]) ListChangeDelims(list, new_delimiter [, delimiters ]) ListContains(list, substring [, delimiters ]) ListContainsNoCase(list, substring [, delimiters ]) ListDeleteAt(list, position [, delimiters ]) ListFind(list, value [, delimiters ]) ListFindNoCase(list, value [, delimiters ]) ListFirst(list [, delimiters ]) ListGetAt(list, position [, delimiters ]) ListInsertAt(list, position, value [, delimiters ]) ListLast(list [, d
DecrementValue(number) Exp(number) Fix(number) IncrementValue(number) InputBaseN(string, radix) Int(number) Log(number) Log10(number) Max(number1, number2) Min(number1, number2) Pi() Rand() Randomize(number) RandRange(number1, number2) Round(number) Sgn(number) Sin(number) Sqr(number) Tan(number) Query functions IsQuery(value) QueryAddColumn(query, column-name, array-name) QueryAddRow(query [, number ]) QueryNew(columnlist) QuerySetCell(query, column_name, value [, row_number ]) QuotedValueList(query.
ParseDateTime(string1 [, string2 ] ) REFind(reg_expression, string [, start ] [, returnsubexpressions ] ) REFindNoCase(reg_expression, string [, start ] [, returnsubexpressions ] ) RemoveChars(string, start, count) RepeatString(string, count) Replace(string, substring1, substring2 [, scope ]) ReplaceList(string, list1, list2) ReplaceNoCase(string, substring1, substring2 [, scope ]) REReplace(string, reg_expression, substring [, scope ]) REReplaceNoCase(string, reg_expression, substring [, scope ]) Reverse(s
Other functions AuthenticatedUser() AuthenticatedContext() CreateObject("COM", class or progid, "INPROC or LOCAL or REMOTE ", , servername) CreateObject("CORBA", filename or naming_context_name, IOR or naming_service, int_orb_args, ) CreateObject("JAVA", classname) CreateUUID() Decrypt(encrypted_string, key) DeleteClientVariable("name") Encrypt(string, key) GetBaseTagData(tagname [, instancenumber ] ) GetBaseTagList() GetClientVariablesList() GetFunctionList() GetTickCount() † ParameterExists(parameter) Pre
ColdFusion Variables ColdFusion returns a wide variety of variables, such as those returned in a CFDIRECTORY or CFFTP operation. Variables are usually referenced by "scoping" the variable according to its type, as in Session.varname, or Application.varname. Variable scope ColdFusion supports the Variables scope. Unscoped variables created with the CFSET tag acquire the Variables scope by default. For example, the variable created by: can be referenced as: #Variables.
Custom tag variables Any ColdFusion custom tag returns the following variables: ThisTag.ExecutionMode ThisTag.HasEndTag ThisTag.GeneratedContent ThisTag.AssocAttribs[index] A custom tag can also set a Caller variable to provide information to the caller. The Caller variable is set as follows: The calling page can access the variable with the tag: #Caller.
ColdFusion Tag-Specific Variables A number of ColdFusion tags return data as variables. For example, the CFFILE tag returns file size information in the FileSize variable, referenced as CFFILE.FileSize.
CFDIRECTORY variables When used with ACTION=LIST, CFDIRECTORY returns a query object. Queryname is the value of the NAME attribute used in the CFDIRECTORY operation. queryname.Name queryname.Size queryname.Type queryname.DateLastModified queryname.Attributes queryname.Mode CFERROR variables When CFERROR generates an error page, the following error variables are available if you have specified TYPE="Request", TYPE="Exception" or TYPE="Monitor." Error.Diagnostics Error.MailTo Error.DateTime Error.
CFFILE ACTION=Upload variables File variables are read-only. Use the CFFILE. prefix to reference file variables: CFFILE.ClientDirectory. Note that although still supported, the File. prefix is deprecated in favor of the CFFILE. prefix. CFFILE.AttemptedServerFile CFFILE.ClientDirectory CFFILE.ClientFile CFFILE.ClientFileExt CFFILE.ClientFileName CFFILE.ContentSubType CFFILE.ContentType CFFILE.DateLastAccessed CFFILE.FileExisted CFFILE.FileSize CFFILE.FileWasAppended CFFILE.FileWasOverwritten CFFILE.
CFFTP query object columns When you use CFFTP with the ListDir action, CFFTP returns a query object. Queryname is the value of the NAME attribute used in the CFFTP operation. Row is the row number for each file/directory entry returned by the ListDir operation. A separate row is created for each entry. queryname.Name[row] queryname.Path[row] queryname.URL[row] queryname.Length[row] queryname.LastModified[row] CFHTTP variables CFHTTP GET operations can return text and binary files.
CFQUERY and CFSTOREDPROC variables In addition to returning data from a ColdFusion data source, the CFQUERY tag also returns information about the query: CFQUERY.ExecutionTime CFQUERY also uses the name of the query to scope data about the query: queryname.CurrentRow queryname.RecordCount queryname.ColumnList The CFSTOREDPROC tag also returns: CFSTOREDPROC.ExecutionTime CFSTOREDPROC.
Standard CGI Variables This is a list of CGI 1.1 variables many Web servers create when a CGI script is called. NOTE: The CGI variables that are available for your use vary with the Web server and configuration. Some of the following variables may not be available to you. Request CGI.AUTH_TYPE CGI.CONTENT_LENGTH CGI.CONTENT_TYPE CGI.PATH_INFO CGI.PATH_TRANSLATED CGI.QUERY_STRING CGI.REMOTE_ADDR CGI.REMOTE_HOST CGI.REMOTE_USER CGI.REQUEST_METHOD CGI.SCRIPT_NAME Server CGI.GATEWAY_INTERFACE CGI.
ColdFusion Studio Keyboard Shortcuts Studio offers a full set of keyboard commands for its tools and functions. The listing below generally matches the order of the menu commands, with related shortcuts added. You can change shortcut key combinations and add new ones by opening the Options > Customize dialog and selecting the Keyboard Shortcuts tab.
File and Document Shortcuts (Continued) Command Key Goto next start tag Ctrl + ] (right bracket) Goto previous start tag Ctrl + [ (left bracket) Delete line Ctrl + Y Delete string Ctrl + Del Delete previous string Ctrl + Backspace Search > Find Ctrl + F Search > Replace Ctrl + R Search > Find Next F3 Search > Extended Find Shift + Ctrl + F Search > Extended Replace Shift + Ctrl + R Tools > Tag Chooser Ctrl+E Tools > Expression Builder Shift + Ctrl + E Tools > Spell Check F7 Tools
File and Document Shortcuts (Continued) Command Key Tags > Insert BR tag and new line Ctrl + Enter Tags > Insert Align Center code Shift + Ctrl + C Tags > Insert Comment tag Shift + Ctrl + M Tags > Open IMG dialog Shift + Ctrl + I Tags > Insert Italic tag Ctrl + I Tags > Insert Non-breaking Space Shift + Ctrl + Spacebar Tags > Insert Paragraph tag Shift + Ctrl + P Tags > Find Matching Tag Ctrl + M Tags > Show Tag Tip for current tag (Esc to close) F2 Tags > Edit Current Tag Ctrl + F4 T
File and Document Shortcuts (Continued) Command Key Show Tag Tip for current tag (Esc to close) F2 Show Tag Insight for current tag (Esc to close) Shift + F2 Debugger Keyboard Shortcuts Debugger Shortcuts Command Key Start/Continue Ctrl + F5 Start - No debugging Ctrl + Alt + F5 End Alt + F5 Restart Ctrl + Shift + F5 Step Into Ctrl + F8 Step Over Ctrl + F9 Run To Cursor Ctrl + F11 Variables Alt + Q Watches Alt + W Recordsets Alt + R Stack Alt + K Output Alt + P Breakpoints Al
30 Quick Reference to CFML