Chapter 1: ColdFusion Tags
43
Example
<!--- This example shows the use of CFEXIT, and
is a read-only example --->
<HTML>
<HEAD>
<TITLE>CFEXIT Example</TITLE>
</HEAD>
<BODY>
<H3>CFEXIT Example</H3>
<P>CFEXIT can be used to abort the processing of the
currently executing CFML custom tag. Execution will resume
immediately following the invocation of the custom tag in the
page that called the tag.
<H3>Usage of CFEXIT</H3>
<P>CFEXIT is used primarily to perform a conditional stop
of processing inside of a custom tag. CFEXIT returns control
to the page that called that custom tag, or in the case of
a tag called by another tag, to the calling tag.
<!--- CFEXIT can be used inside a CFML custom tag, as
follows: --->
<!--- Place this code (uncomment the appropriate
sections) inside the CFUSION/customtags directory --->
<!--- MyCustomTag.cfm --->
<!--- This simple custom tag checks for the existence
of myValue1 and myValue2. If they are both defined,
the tag adds them and returns the result to the calling
page in the variable "result". If either or both of the
expected attribute variables is not present, an error message
is generated, and CFEXIT returns control to the
calling page. --->
<!--- <CFIF NOT IsDefined("attributes.myValue2")>
<CFSET caller.result = "Value2 is not defined">
<CFEXIT METHOD="ExitTag">
<CFELSEIF NOT IsDefined("attributes.myValue1")>
<CFSET caller.result = "Value1 is not defined">
<CFEXIT METHOD="ExitTag">
<CFELSE>
<CFSET value1 = attributes.myValue1>
<CFSET value2 = attributes.myValue2>
<CFSET caller.result = value2>
</CFIF> --->
<!--- End MyCustomTag.cfm --->
<!--- And place this code inside your page --->
<!--- <P>The call to the custom tag, and then the result:
<CF_myCustomTag
myvalue2 = 4>
<CFOUTPUT>#result#</cFOUTPUT> --->
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...