MACROMEDIA COLFUSION MX 7-CFML Reference page 530

Cfml reference
Hide thumbs Also See for COLFUSION MX 7-CFML:
Table of Contents

Advertisement

CreateObject: component object
Description
The
CreateObject
Returns
A component object.
Function syntax
CreateObject(type, component-name)
See also
Chapter 10, "Building and Using ColdFusion Components" in ColdFusion MX Developer's Guide
Parameters
Parameter
type
component-name
Usage
On UNIX systems, ColdFusion searches first for a file with a name that matches the specified
component name, but is all lowercase. If it does not find the file, it looks for a file name that
matches the component name exactly, with the identical character casing.
In the following example, the CFScript statements assign the
component using the
tellTime
the component in another directory. To invoke component methods, you use function syntax.
<b>Server's Local Time:</b>
<cfscript>
tellTimeCFC=CreateObject("component","appResources.components.
tellTime");
tellTimeCFC.getLocalTime();
</cfscript>
<br>
<b>Calculated UTC Time:</b>
<cfscript>
tellTimeCFC.getUTCTime();
</cfscript>
530
Chapter 3: ColdFusion Functions
function can create an instance of a ColdFusion component (CFC) object.
Description
Type of object to create.
• com
• corba
• java
• component
• webservice
The CFC name; corresponds to the name of the file that defines the
component; for example, use engineComp to specify the component defined
in the engineComp.cfc file
CreateObject
tellTimeCFC
function. The
CreateObject
variable to the
function references

Advertisement

Table of Contents
loading

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents