MACROMEDIA COLDFUSION 4.5-QUICK REFERENCE TO CFML Quick Reference
MACROMEDIA COLDFUSION 4.5-QUICK REFERENCE TO CFML Quick Reference

MACROMEDIA COLDFUSION 4.5-QUICK REFERENCE TO CFML Quick Reference

Advertisement

Quick Links

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.
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-45QKR-RK
Allaire Corporation

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-QUICK REFERENCE TO CFML and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for MACROMEDIA COLDFUSION 4.5-QUICK REFERENCE TO CFML

  • Page 1 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.
  • Page 2: Table Of Contents

    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 ........13 Format conversion functions ..........13 List functions .................14 International functions ............14 Mathematical functions ............14 Query functions ..............15 String functions ..............15 Structure functions .............16...
  • Page 3 Standard CGI Variables ........25 Request ................... 25 Server ..................25 Client ..................25 ColdFusion Studio Keyboard Shortcuts ...26 File and Document Keyboard Shortcuts ....26 Debugger Keyboard Shortcuts ........29 Quick Reference to CFML...
  • Page 4: Cfml Tags

    CFML Tags CFABORT <CFABORT SHOWERROR="text"> CFAPPLET <CFAPPLET APPLETSOURCE="applet_name" NAME="form_variable_name" HEIGHT="pixels" WIDTH="pixels" VSPACE="pixels" HSPACE="pixels" ALIGN="alignment" NOTSUPPORTED="text" param_1="value" param_2="value" param_n="value"> CFAPPLICATION <CFAPPLICATION NAME="Name" CLIENTMANAGEMENT="Yes" or "No" CLIENTSTORAGE="Storage Type" SETCLIENTCOOKIES="Yes" or "No" SESSIONMANAGEMENT="Yes" or "No" SESSIONTIMEOUT=#CreateTimeSpan(days, hours, minutes, seconds)# APPLICATIONTIMEOUT=#CreateTimeSpan(days, hours, minutes, seconds)# SETDOMAINCOOKIE="Yes"...
  • Page 5 CFDIRECTORY <CFDIRECTORY ACTION="directory action" DIRECTORY="directory name" NAME="query name" FILTER="list filter" MODE="permission" SORT="sort specification" NEWDIRECTORY="new directory name"> CFERROR <CFERROR TYPE="Request" or "Validation" or "Monitor" or "Exception" TEMPLATE="template_path" MAILTO="email_address" EXCEPTION="exception_type"> CFEXECUTE <CFEXECUTE NAME=" ApplicationName " ARGUMENTS="CommandLine Arguments" OUTPUTFILE="Output file name" TIMEOUT="Timeout interval in seconds"> CFEXIT <CFEXIT METHOD="method">...
  • Page 6 PORT="port" CONNECTION="name" PROXYSERVER="proxyserver" PROXYBYPASS="proxybypass" RETRYCOUNT="number" STOPONERROR="Yes" or "No" PASSIVE="Yes" or "No"> <CFFTP ACTION="action" USERNAME="name" PASSWORD="password" NAME="query_name" SERVER="server" ASCIIEXTENSIONLIST="extensions" TRANSFERMODE="mode" FAILIFEXISTS="Yes" or "No" DIRECTORY="directory name" LOCALFILE="filename" REMOTEFILE="filename" ATTRIBUTES="file attributes" ITEM="directory or file" EXISTING="file or directory name" NEW="file or directory name" PROXYSERVER="proxyserver" PROXYBYPASS="proxybypass"...
  • Page 7 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 <CFGRIDROW DATA="col1, col2, ..."> CFGRIDUPDATE <CFGRIDUPDATE GRID="gridname" DATASOURCE="data source name" DBTYPE="type"...
  • Page 8 CFIMPERSONATE <CFIMPERSONATE SECURITYCONTEXT="SecurityContext" USERNAME="Name" PASSWORD="Password" TYPE= "CF" or "OS"> HTML or CFML code to execute </CFIMPERSONATE> CFINCLUDE <CFINCLUDE TEMPLATE="template_name"> CFINDEX <CFINDEX COLLECTION="collection_name" ACTION="action" TYPE="type" TITLE="title" KEY="ID" BODY="body" CUSTOM1="custom_value" CUSTOM2="custom_value" URLPATH="URL" EXTENSIONS="file_extensions" QUERY="query_name" RECURSE="Yes" or "No" EXTERNAL="Yes" or "No" LANGUAGE="language"> CFINPUT <CFINPUT TYPE="input_type"...
  • Page 9 CFLOCATION <CFLOCATION URL="url" ADDTOKEN="Yes" or "No"> CFLOCK <CFLOCK TIMEOUT="timeout in seconds " SCOPE="Application" or "Server" or "Session" NAME="lockname" THROWONTIMEOUT="Yes" or "No" TYPE= "ReadOnly" or "Exclusive "> <!--- CFML to be synchronized ---> </CFLOCK> CFLOOP <CFLOOP INDEX="parameter_name" FROM="beginning_value" TO="ending_value" STEP="increment"> HTML or CFML code to execute </CFLOOP>...
  • Page 10 CFOBJECT <CFOBJECT TYPE="COM" ACTION="action" CLASS="program_ID" NAME="text" CONTEXT="context" SERVER="server_name"> <CFOBJECT TYPE="CORBA" CONTEXT="context" CLASS="file or naming service" NAME="text" LOCALE="type-value arguments"> <CFOBJECT TYPE="Java" ACTION="Create" CLASS="Java class" NAME="object name"> CFOUTPUT <CFOUTPUT MAXROWS="max_rows_output" QUERY="query_name" GROUP="query_column" GROUPCASESENSITIVE="Yes" or "No" STARTROW="start_row"> </CFOUTPUT> CFPARAM <CFPARAM NAME="param_name" TYPE="data_type"> DEFAULT="value"> CFPOP <CFPOP SERVER="servername"...
  • Page 11 CFQUERY <CFQUERY NAME="query_name" DATASOURCE="ds_name" DBTYPE="type" DBSERVER="dbms" DBNAME="database name" USERNAME="username" PASSWORD="password" MAXROWS="number" BLOCKFACTOR="blocksize" TIMEOUT="milliseconds" CACHEDAFTER="date" CACHEDWITHIN="timespan" PROVIDER="COMProvider" PROVIDERDSN="datasource" DEBUG="Yes" or "No"> SQL statements </CFQUERY> CFQUERYPARAM <CFQUERY NAME="query_name" DATASOURCE="ds_name" ...other attributes... > SELECT STATEMENT WHERE column_name= <CFQUERYPARAM VALUE="parameter value" CFSQLType="parameter type" MAXLENGTH="maximum parameter length" SCALE="number of decimal places"...
  • Page 12 CFSEARCH <CFSEARCH NAME="search_name" COLLECTION="collection_name" TYPE="criteria" CRITERIA="search_expression" MAXROWS="number" STARTROW="row_number" EXTERNAL="Yes" or "No" LANGUAGE="language"> CFSELECT <CFSELECT NAME="name" REQUIRED="Yes" or "No" MESSAGE="text" ONERROR="text" SIZE="integer" MULTIPLE="Yes" or "No" QUERY="queryname" SELECTED="column_value" VALUE="text" DISPLAY="text" PASSTHROUGH="HTML_attributes"> </CFSELECT> CFSERVLET <CFSERVLET CODE="class name of servlet" JRUNPROXY="proxy server" TIMEOUT="timeout in seconds" WRITEOUTPUT="Yes"...
  • Page 13 GROOVECOLOR="color" BGCOLOR="color" TEXTCOLOR="color" FONT="font_name" FONTSIZE="integer" ITALIC="Yes" or "No" BOLD="Yes" or "No" NOTSUPPORTED="text"> CFSTOREDPROC <CFSTOREDPROC PROCEDURE="procedure name" DATASOURCE="ds_name" USERNAME="username" PASSWORD="password" DBSERVER="dbms" DBNAME="database name" BLOCKFACTOR="blocksize" PROVIDER="COMProvider" PROVIDERDSN="datasource" DEBUG="Yes" or "No" RETURNCODE="Yes" or "No"> CFSWITCH CFCASE CFDEFAULTCASE <CFSWITCH EXPRESSION="expression"> <CFCASE VALUE="value" DELIMITERS="delimiters"> HTML and CFML tags </CFCASE>...
  • Page 14 CFTREE <CFTREE NAME="name" REQUIRED="Yes" or "No" DELIMITER="delimiter" COMPLETEPATH="Yes" or "No" APPENDKEY="Yes" or "No" HIGHLIGHTHREF="Yes" or "No" ONVALIDATE="script_name" MESSAGE="text" ONERROR="text" FONT="font" FONTSIZE="size" ITALIC="Yes" or "No" BOLD="Yes" or "No" HEIGHT="integer" WIDTH="integer" VSPACE="integer" HSPACE="integer" ALIGN="alignment" BORDER="Yes" or "No" HSCROLL="Yes" or "No" VSCROLL="Yes" or "No" NOTSUPPORTED="text">...
  • Page 15: 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 )
  • Page 16: Decision Functions

    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 )
  • Page 17: List Functions

    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 ])
  • Page 18: Query Functions

    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 )
  • Page 19: Structure Functions

    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...
  • Page 20: Other Functions

    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()
  • Page 21: 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 22: 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.
  • Page 23: 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 24: 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 25: 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 26: 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. A sepa- rate row is created for each entry.
  • Page 27: Cfquery And Cfstoredproc Variables

    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:...
  • Page 28: 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 29: Coldfusion Studio Keyboard Shortcuts

    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 >...
  • Page 30 File and Document Shortcuts (Continued) Command 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 >...
  • Page 31 Shift + Ctrl + L 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...
  • Page 32: Debugger Keyboard Shortcuts

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

This manual is also suitable for:

Coldfusion 4.5

Table of Contents