MACROMEDIA COLDFUSION 5-CFML Quick Reference

Cfml quick reference
Hide thumbs Also See for COLDFUSION 5-CFML:

Advertisement

Quick Links

CFML Quick Reference
© 2001 Macromedia Incorporated. 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 Macromedia
Incorporated. Macromedia Incorporated 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 Macromedia
Incorporated.
ColdFusion and HomeSite are federally registered trademarks of
Macromedia Incorporated. HomeSite, the ColdFusion logo and the
Allaire logo are trademarks of Macromedia Incorporated in the USA
and other countries. Microsoft, Windows, Windows NT, Windows 95,
Microsoft Access, and FoxPro are registered trademarks of Microsoft
Corporation. Solaris is a trademark of Sun Microsystems Inc. UNIX is
a trademark of The Open Group. PostScript is a trademark of Adobe
Systems Inc. All other products or name brands are the trademarks
of their respective holders.
Part number: ZCF50MQKREF
Macromedia® Incorporated

Advertisement

Table of Contents
loading

Summary of Contents for MACROMEDIA COLDFUSION 5-CFML

  • Page 1 ColdFusion and HomeSite are federally registered trademarks of Macromedia Incorporated. HomeSite, the ColdFusion logo and the Allaire logo are trademarks of Macromedia Incorporated in the USA and other countries. Microsoft, Windows, Windows NT, Windows 95, Microsoft Access, and FoxPro are registered trademarks of Microsoft Corporation.
  • Page 3: Table Of Contents

    Contents CFML Tags ............. 1 CFML Functions ..........14 Array functions ..............14 Authentication functions ..........14 Conversion functions ............14 Date and time functions ...........14 Decision functions ...............15 Display and formatting functions ........15 Dynamic evaluation functions ........16 International functions ............16 List Functions ................16 Mathematical functions ............17 Query functions ..............17 String functions ..............17...
  • Page 4 CFSERVLET variables ............26 Standard CGI Variables ........27 Request ................... 27 Server ..................27 Client ..................27 ColdFusion Studio Keyboard Shortcuts ...28 File and document keyboard shortcuts ..... 28 Debugger Keyboard Shortcuts ........31 CFML Quick Reference...
  • Page 5: Cfml Tags

    CFML Tags cfabort <cfabort showError = "error_message"> cfapplet <cfapplet appletSource = "applet_name" name = "form_variable_name" height = "height_in_pixels" width = "width_in_pixels" vSpace = "space_above_and_below_in_pixels" hSpace = "space_on_each_side_in_pixels" align = "Left" or "Right" or "Bottom" or "Top" or "TextTop" or "Middle" or "AbsMiddle" or "Baseline" or "AbsBottom" notSupported = "message_to_display_for_nonJava_browser"...
  • Page 6 cfcookie <cfcookie name = "cookie_name" value = "text" expires = "period" secure = "Yes" or "No" path = "url" domain = ".domain"> cfdirectory <cfdirectory action = "directory action" directory = "directory name" name = "query name" filter = "list filter" mode = "permission"...
  • Page 7 enableCAB = "Yes" or "No" onSubmit = "javascript" target = "window_name" encType = "type" passThrough = "HTML_attributes" codeBase = "URL" archive = "URL" > </cfform> cfftp <cfftp action = "establish_FTP_connection" username = "name" password = "password" server = "server" timeout = "timeout in seconds" port = "port"...
  • Page 8 fileFormat = "Flash", "gif" or "jpg" lineColor = "Web color" lineWidth = integer number of pixels fill = "yes" or "no" graphHeight = integer number of pixels graphWidth = integer number of pixels backgroundColor = "Web color" borderColor = "Web color" borderWidth = integer number of pixels depth = integer number of pixels gridLines = integer number of lines>...
  • Page 9 rowHeaderTextColor = "Web color" rowHeaderWidth = "col_width" colHeaders = "Yes" or "No" colHeaderAlign = "position" colHeaderFont = "font_name" colHeaderFontSize = "size" colHeaderItalic = "Yes" or "No" colHeaderBold = "Yes" or "No" colHeaderTextColor = "Web color" bgColor = "Web color" selectColor = "Web color" selectMode = "mode"...
  • Page 10 cfhttp <cfhttp url = "hostname" port = "port_number" method = "get_or_post" username = "username" password = "password" name = "queryname" columns = "query_columns" path = "path" file = "filename" delimiter = "character" textQualifier = "character" resolveURL = "yes" or "no" proxyServer = "hostname"...
  • Page 11 cfinsert <cfinsert dataSource = "ds_name" dbType = "type" dbServer = "dbms" dbName = "database name" tableName = "tbl_name" connectString = "connection string" tableOwner = "owner" tableQualifier = "tbl_qualifier" username = "username" password = "password" provider = "COMProvider" providerDSN = "datasource" formFields = "formfield1, formfield2, ...">...
  • Page 12 cfmail <cfmail to = "recipient" from = "sender" cc = "copy_to" Bcc = "blind_copy_to" subject = "msg_subject" type = "msg_type" maxRows = "max_msgs" MIMEAttach = "path" query = "query_name" group = "query_column" groupCaseSensitive = "Yes" or "No" startRow = "query_row" server = "servername"...
  • Page 13 timeout = "seconds" maxRows = "number" startRow = "number" generateUniqueFilenames = "boolean"> cfprocessingdirective <cfprocessingdirective suppressWhiteSpace = "Yes" or "No"> … any CFML tags here … </cfprocessingdirective> cfprocparam <cfprocparam type = "IN or OUT or INOUT" variable = "variable name" dbVarName = "DB variable name" value = "parameter value"...
  • Page 14 cfreport <cfreport report = "report_path" orderBy = "result_order" username = "username" password = "password" formula = "formula"> </cfreport> cfrethrow <cfrethrow> cfsavecontent <cfsavecontent variable = "variable name"> content </cfsavecontent> cfschedule <cfschedule action = "update" task = "taskname" operation = "HTTPRequest" file = "filename" path = "path_to_file"...
  • Page 15 cfservletparam <cfservlet ...> <cfservletparam name = "servlet parameter name" value = "servlet parameter value"> <cfservletparam name = "servlet attribute name" variable = "coldfusion variable name" type = "INT" or "DOUBLE" or "BOOL" or "DATE" or "STRING"> </cfservlet> cfset <cfset variable_name = expression> cfsetting <cfsetting enableCFoutputOnly = "Yes"...
  • Page 16 cftable <cftable query = "query_name" maxRows = "maxrows_table" colSpacing = "number_of_spaces" headerLines = "number_of_lines" HTMLTable border colHeaders startRow = "row_number"> </cftable> cftextinput <cftextinput name = "name" value = "text" required = "Yes" or "No" range = "min_value, max_value" validate = "data_type" onValidate = "script_name"...
  • Page 17 imgopen = "filename" href = "URL" target = "URL_target" query = "queryname" queryAsRoot = "Yes" or "No" expand = "Yes" or "No"> cftry cfcatch <cftry> ... Add code here <cfcatch type = "exceptiontype"> ... Add exception processing code here </cfcatch> ...
  • Page 18: Cfml Functions

    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 ]) ListToArray(list [, delimiter ]) Authentication functions AuthenticatedContext()
  • Page 19: Decision Functions

    DaysInMonth(date) DaysInYear(date) FirstDayOfMonth(date) GetHttpTimeString(date_time_object) GetTimeZoneInfo() Hour(date) IsDate(string) IsLeapYear(year) IsNumericDate(number) LSDateFormat(date [, mask ]) LSIsDate(string) LSParseDateTime(date/time-string) LSTimeFormat(time [, mask ]) Minute(date) Month(date) MonthAsString(month_number) Now() ParseDateTime(date/time-string [, pop-conversion ] ) Quarter(date) Second(date) TimeFormat(time [, mask ]) Week(date) Year(date) Decision functions IsArray(value [, number ]) IsAuthenticated([security-context-name ]) IsAuthorized(resourcetype, resourcename [, action ]) FileExists(absolute_path)
  • Page 20: Dynamic Evaluation Functions

    LSEuroCurrencyFormat(currency-number [, type ]) LSNumberFormat(number [, mask ]) LSTimeFormat(time [, mask ]) NumberFormat(number [, mask ]) ParagraphFormat(string) TimeFormat(time [, mask ]) YesNoFormat(value) Dynamic evaluation functions DE(string) Evaluate(string_express1 [, string_express2 [,…]]) IIf(condition, string_express1, string_express2) SetVariable(name, value) International functions DateConvert(conversion-type, date) GetHttpTimeString(date_time_object) GetLocale() GetTimeZoneInfo() LSCurrencyFormat(number [, type ])
  • Page 21: Mathematical Functions

    Mathematical functions Abs(number) ACos(number) ASin(number) Atn(number) BitAnd(number1, number2) BitMaskClear(number, start, length) BitMaskRead(number, start, length) BitMaskSet(number, mask, start, length) BitNot(number) BitOr(number1, number2) BitSHLN(number, count) BitSHRN(number, count) BitXor(number1, number2) Ceiling(number) Cos(number) DecrementValue(number) Exp(number) Fix(number) IncrementValue(number) InputBaseN(string, radix) Insert(substring, string, position) Int(number) Log(number) Log10(number) Max(number1, number2) Min(number1, number2)
  • Page 22: Structure Functions

    FormatBaseN(number, radix) GetToken(string, index [, delimiters ]) Hash(string) Insert(substring, string, position) JavaCast(type, variable) JSStringFormat(string) LCase(string) Left(string, count) Len(string or binary object) ListValueCount(list, value [, delimiters ]) ListValueCountNoCase(list, value [, delimiters ]) LJustify(string, length) LSIsCurrency(string) LSParseCurrency(string) LSParseDateTime(date/time-string) LSParseEuroCurrency(currency-string) LSParseNumber(string) LTrim(string) Mid(string, start, count) MonthAsString(month_number) ParseDateTime(date/time-string [, pop-conversion ] ) REFind(reg_expression, string [, start ]...
  • Page 23: System Functions

    StructKeyArray(structure) StructKeyExists(structure, key) StructKeyList(structure, [delimiter]) StructNew() StructSort(base, pathToSubElement, sortOrder, sortType) StructUpdate(structure, key, value) System functions DirectoryExists(absolute_path) ExpandPath(relative_path) FileExists(absolute_path) GetCurrentTemplatePath() GetDirectoryFromPath(path) getException(object) GetFileFromPath(path) GetFunctionList() GetHttpRequestData() GetMetricData(mode) GetProfileString(iniPath, section, entry) GetTempDirectory() GetTempFile(dir, prefix) GetTemplatePath() SetProfileString(iniPath, section, entry, value) Other functions CreateObject("COM", class, context, serverName) CreateObject("CORBA", class, context, locale) CreateObject("Java", class) CreateUUID()
  • Page 24: Coldfusion Variables

    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 vari- ables created with the CFSET tag acquire the Variables scope by default.
  • Page 25: Custom Tag 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 infor- mation to the caller. The Caller variable is set as follows: <CFSET Caller.variable_name = "value"> The calling page can access the variable with the <CFOUT- PUT>...
  • Page 26: Coldfusion Tag-Specific Variables

    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. The following tags return data that can be referenced in vari- ables: •...
  • Page 27: Cfdirectory Variables

    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"...
  • Page 28: Cffile Action=Upload Variables

    CFFILE ACTION=Upload variables File variables are read-only. Use the CFFILE. prefix to refer- ence 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...
  • Page 29: Cfftp Query Object Columns

    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. queryname.Name[row] queryname.Path[row] queryname.URL[row]...
  • Page 30: Cfquery And Cfstoredproc Variables

    CFQUERY and CFSTOREDPROC variables In addition to returning data from a ColdFusion data source, the CFQUERY tag 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.StatusCode...
  • Page 31: Standard Cgi Variables

    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 follow- ing variables may not be available to you.
  • Page 32: Coldfusion Studio Keyboard Shortcuts

    ColdFusion Studio Keyboard Shortcuts Studio offers a full set of keyboard commands for its tools and functions. The list 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 >...
  • Page 33 File and Document Shortcuts (Continued) Command Goto previous start tag Ctrl + [ (left bracket) Go to top of window Ctrl + PgUp Go to bottom of window Ctrl + PgDn Delete line Ctrl + Y Delete string Ctrl + Del Delete previous string Ctrl + Backspace Search >...
  • Page 34 View > Special Characters Shift + Ctrl + X View > Edit/Browse modes View > Edit/Design modes Shift + F12 View > Open in Macromedia Ctrl + D DreamWeaver Open current document in external browser Toggle focus between Editor and...
  • Page 35: Debugger Keyboard Shortcuts

    File and Document Shortcuts (Continued) Command Show Tag Tip for current tag (Esc to close) Show Tag Insight for current tag (Esc Shift + F2 to close) Debugger Keyboard Shortcuts Debugger Shortcuts Command Start/Continue Ctrl + F5 Start - No debugging Ctrl + Alt + F5 Alt + F5 Restart...
  • Page 36 CFML Quick Reference...

This manual is also suitable for:

Coldfusion 5

Table of Contents