Adobe COLDFUSION 9 Manual page 131

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
The CFML Programming Language
• writelog
• location
• trace
You can call these functions by passing the argument as name="value" pairs or positional notations. For positional
notations, the sequence of arguments must be followed. The sequence of arguments for each construct is mentioned
in the CFML Reference Guide.
Example of passing arguments as name=value pair:
<cfscript>
writedump(var=myquery, label="query", show="name", format = "text");
</cfscript>
Example of passing arguments as Positional arguments:
<cfscript
writedump(myquery, false, html, name)
<cfscript>
You do not need to specify all the parameters while using positional arguments. For instance, if you want to specify
the first and third argument, you can add an empty value for the second argument. The exception to this usage is when
there is a boolean type for the second argument where you have to specify
Note: You cannot mix positional and named arguments while calling a function. For example, if you need to use only the
and
attributes with the
var
output
Import and new operations using cfimport
CFScript supports import and new operations. "New" is now a keyword. However, it is not a reserved word, so you can
use it as a variable name.
You can use the cfimport tag or import script operator to import a CFC. The import operation puts the contents of the
specified component in the current name space, and caches the resolved component path in memory. The import
action is effective on the current page only. If you import CFCs in Application.cfm, the CFC is not imported on other
pages of the application.
You refer to the imported component directly without using a dot-delimited pathname. Execution time for cached
components is faster than with CFCs that you do not import.
Note: The cfobject and cfobject tags and the CreateObject function also cache the resolved component path. They do not,
however, invoke an initializer function.
In script the import statement has the following syntax:
import "cfc_filepath"
Quotation marks are optional for most paths. Surround the path in quotation marks if any directory or the CFC name
has a hyphen.
The cfimport tag now supports importing CFCs and takes a path attribute to specify the path to the CF file to import.
Use the import function or cfimport tag with a path attribute on top of the page only. Using them elsewhere has the
same effect as putting them on top of the page. Therefore, standard coding practice places the import tags or operators
at the top of the file. The cfimport tag can precede a cfcomponent tag. The import CFScript statement must follow the
component statement.
construct, you can use
writedump
Last updated 8/5/2010
or
.
true
false
writedump(myquery,html)
126
.

Advertisement

Table of Contents
loading

Table of Contents