> I need some clarification, what is the difference between a
> UDF & a Custom Tag? Are they stored & called the same way?
A User-defined function (UDF) is a code module written in CFSCRIPT in (or
included into) your ColdFusion program file - you might hear UDFs referred
to as "inline" functions. Within the CFSCRIPT tag block, UDFs are written
using the function syntax found in JavaScript:
<cfscript>
function myfunction(foo, bar) {
return foo * bar;
}
</cfscript>
User-defined functions share the same scopes as the page within which
they're contained, although you can use the var keyword to declare variables
local to that function. They're called as you'd call any built-in CF
function:
<cfset mynum = myfunction(5, 3)>
User-defined functions were introduced with CF 5.
Custom tags, on the other hand, are separate ColdFusion program files, which
are called from other ColdFusion program files. They have their own scopes,
and are called as any other CF tags would be called. They can be stored in
many places, and called using CF_TAGNAME syntax, or using the CFMODULE tag.
Custom tags are significantly more powerful, but have greater overhead
(which shouldn't be surprising since they're really separate programs).
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists