> Below are two code snippets. What I am wondering is if
> they are both exactly the same in their functionality?
> Is it the case that both code blocks will exit execution
> of a custom tag if the tag is referenced WITH an ending tag?
> And if so, why would anyone do such a thing? I'd think that
> you'd want to exit a custom tag if it is missing an end
> tag (i.e., incomplete), not the other way around!
>
> <cfif find(thisTag.executionMode, "end")>
> <cfexit method="EXITTAG">
> </cfif>
>
> <cfIf Expression="#ThisTag.HasEndTag#">
> <cfexit method="EXITTAG">
> </cfIf>
I'm not sure exactly what each snippet is supposed to do, but I don't think
they're going to do what you think they will, and I don't think they'll do
the same thing, either. Confused yet?
The first one will, if run, check to see whether the custom tag is in its
ending execution mode, and if so, it'll exit. The second one will compare
the value of the variable "Expression" with the Boolean value returned by
ThisTag.HasEndTag, and if they're the same, it'll exit the tag (in this
case, it could happen during either the start or end execution modes).
What you probably want is something like this:
<cfif ThisTag.ExecutionMode is "start">
<!--- start mode --->
<cfif not ThisTag.HasEndTag>
This fancy-schmancy custom tag needs an end tag, you dolt!
And you call yourself a programmer! For shame! Read my
documentation, for crying out loud!
<cfexit>
</cfif>
... do something in start mode ...
<cfelse>
<!--- end mode --->
... do something in end mode ...
</cfif>
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
______________________________________________________________________
Why Share?
Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
Instant Activation � $99/Month � Free Setup
http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists