Chapter 1: ColdFusion Tags
145
Example
<HTML>
<HEAD>
<TITLE>CFOBJECT (COM) Example</TITLE>
</HEAD>
<BODY>
<H3>CFOBJECT (COM) Example</H3>
<!---
Create a COM object as an inproc server (DLL).
(CLASS= prog-id)
--->
<CFOBJECT ACTION="Create"
TYPE="COM"
CLASS=Allaire.DocEx1.1
NAME="obj">
<!---
Call a method.
Note that methods that expect no arguments should
be called using empty parenthesis.
--->
<CFSET obj.Init()>
<!---
This object is a collection object, and should
support at a minimum:
Property : Count
Method : Item(inarg, outarg)
and a special property called _NewEnum
--->
<CFOUTPUT>
This object has #obj.Count# items.
<BR>
<HR>
</CFOUTPUT>
<!---
Get the 3rd object in the collection.
--->
<CFSET emp = obj.Item(3)>
<CFOUTPUT>
The last name in the third item is #emp.lastname#.
<BR>
<HR>
</CFOUTPUT>
<!---
Loop over all the objects in the collection.
--->
<P>Looping through all items in the collection:
<BR>
<CFLOOP COLLECTION=#obj# ITEM=file2>
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...