<!--- This view-only example shows the use of CFMODULE --->
<HTML>
<HEAD>
<TITLE>CFMODULE Example</TITLE>
</HEAD>

<BASEFONT FACE="Arial, Helvetica" SIZE=2>

<BODY  bgcolor="#FFFFD5">

<BODY>
<H3>CFMODULE Example</H3>

<P>
This example shows the use of CFMODULE to call a sample custom 
tag inline.
</P>
<P>
This example makes use of a sample custom tag that has been saved in the file myTag.cfm in 
the snippets directory. You can also save ColdFusion custom tags in the Cfusion\CustomTags 
directory. For more information about using Custom Tags, please refer to 
<i>Developing Web Applications</i>.
</P>
<!--- show the code in the custom tag--->	
<HR size="2" color="#0000A0">
<P>Here is the code in the custom tag.</P>
<CFOUTPUT>#HTMLCodeFormat("<CFSET X = attributes.x>
<CFSET Y = attributes.y>
<CFSET A = attributes.value1>
<CFSET B = attributes.value2>
<CFSET C = attributes.value3>
<CFSET caller.result = x + y + a + b + c>")#
</CFOUTPUT>
<!--- end sample tag --->

<CFSET attrCollection1 = StructNew()>

<CFSET attrCollection1.value1 = 22>

<CFSET attrCollection1.value2 = 45>

<CFSET attrCollection1.value3 = 88>

<!--- Call the tag with CFMODULE with Name--->
<CFMODULE 
   Template="..\snippets\myTag.cfm"
	X="3"
	attributeCollection=#attrCollection1# 
	Y="4">

<!--- show the code --->
<HR size="2" color="#0000A0">
<P>Here is one way in which to invoke the custom tag, 
using the TEMPLATE attribute.</P>
<CFOUTPUT>#HTMLCodeFormat("	<CFMODULE
	Template=""..\snippets\myTag.cfm""
	X=3
	attributeCollection=##attrCollection1##
	Y=4>")#
</CFOUTPUT>	
<P>The result: <CFOUTPUT>#result#</CFOUTPUT>	

<!--- Call the tag with CFMODULE with Name--->
<CFMODULE 
    Name="myTag"
	X="3"
	attributeCollection=#attrCollection1# 
	Y="4">

<!--- show the code --->
<HR size="2" color="#0000A0">
<P>Here is another way to invoke the custom tag, 
using the NAME attribute.</P>
<CFOUTPUT>#HTMLCodeFormat("	<CFMODULE
	NAME='myTag'
	X=3
	attributeCollection=##attrCollection1##
	Y=4>")#
</CFOUTPUT>	
<P>The result: <CFOUTPUT>#result#</CFOUTPUT>	

<!--- Call the tag using the short cut notation --->
<CF_myTag 
	X="3" 
	attributeCollection=#attrCollection1# 
	Y="4">
	
<!--- show the code --->	
<HR size="2" color="#0000A0">
<P>Here is the short cut to invoking the same tag.</P>
<CFOUTPUT>#HTMLCodeFormat("	<CF_myTag 
	X=3 
	attributeCollection=##attrCollection1## 
	Y=4>")#
</CFOUTPUT>	
<P>The result: <CFOUTPUT>#result#</CFOUTPUT></P>	


</BODY>
</HTML>       
