>
> I need some clarification, what is the difference between a
> UDF & a Custom Tag? Are they stored & called the same way?
>
Big question. Your best bet is to read the CF docs, or any of the new
CF5 books, but, as a general overview:
Custom tags are called via <CF_Foo>, where Foo is the name of the custom
tag, or <CFMODULE>. Custom tags are written in normal CFML, and are
stored in either the same directory or in the custom tags directory. CTs
(custom tags) provide a "black box" type protection for your code. This
means code inside the CT is safe from overwriting code in the calling
template. So, if your file, index.cfm, had set X to 1, and CT sets X to
2, it will NOT change the value of X in the calling template. Of course,
CTs provide ways of returning values.
UDFs are written in CFSCRIPT only. UDFs must either be declared on the
page, or in an cfincluded page. UDFs have access to the page's local
variables, so extra steps must be taken to not 'step' on them. UDFs are
a bit easier to call as well. For example, imagine a CT and a UDF that
return if an email is valid or not:
<CF_IsEmail Email="ray@yourmother" r_isEmail="ValidEmail">
<CFIF ValidEmail>
.
</CFIF>
Compared to:
<CFIF IsEmail("ray@yourmothter")>
...
</CFIF>
Obviously the UDF is _much_ cleaner.
I'm going to stop writing now, because if I don't, I'll have a mini book
here. Again, check the docs. Also, you can check out www.cflib.org for a
set of free UDFs. You can examine them and learn from them.
=======================================================================
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia
Email : [EMAIL PROTECTED]
Yahoo IM : morpheus
"My ally is the Force, and a powerful ally it is." - Yoda
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists