RE: UDF Vs Custom Tags?

2001-09-13 Thread Andrew Scott

No!

UDF's allow you to create a function, where a customtag is more like the
name suggests. So you can do something like what is below in a UDF:-

cfset test = CustomFunction(var1,var2,var..)


Regards,
Andrew Scott


-Original Message-
From: Will Ryan [mailto:[EMAIL PROTECTED]] 
Sent: Friday, 14 September 2001 12:15 AM
To: CF-Talk
Subject: UDF Vs Custom Tags?

Hello All,

  I need some clarification, what is the difference between a UDF  a
Custom
Tag?  Are they stored  called the same way?

-TIA
 Will
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
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



RE: UDF Vs Custom Tags?

2001-09-13 Thread Raymond Camden

 
   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



RE: UDF Vs Custom Tags?

2001-09-13 Thread Thomas Chiverton

   I need some clarification, what is the difference between a 
 UDF  a Custom
 Tag?  Are they stored  called the same way?

I'd usualy just tell someone to RTFM, but I'm bored today.

A custom tag is called like:
cf_mytag wibble=rar rar=wibble
kdsgsdgsdg sdg sgd sdg 
/cf_mytag

A UDF is used like:
cfquery name=qQuery datasource=#myUDF(session.username)#
select ...
/cfquery
or inside a cfscript block, just like any other CF function.

Custom tags have to reside in a seperate file, UDF's may be declared inline
~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
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



Re: UDF Vs Custom Tags?

2001-09-13 Thread Trishan Singh

Well actually they are very diffenent but yet the same...

A UDF is a function Use a cfscript block to define a User Defined
Function in a C++/Java style function which is used as a
#UserDefinedFunction()#

A Custom Tag is a mini applicaion... Creating a new CFM that is completely
self reliant with all info being passed to it  cf_UserCustomTag
With=Variables Passed=Using These=Methods

If you research it a little youll find the details on the benifits and
drawbacks of each
Hope this help...

Trishan Singh
ACP/CCFD
[EMAIL PROTECTED]
316-204-1097
Paracom Technologies
Wichita KS

- Original Message -
From: Will Ryan [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Thursday, September 13, 2001 9:14 AM
Subject: UDF Vs Custom Tags?


 Hello All,

   I need some clarification, what is the difference between a UDF  a
Custom
 Tag?  Are they stored  called the same way?

 -TIA
  Will

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
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



RE: UDF Vs Custom Tags?

2001-09-13 Thread Dave Watts

 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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: UDF Vs Custom Tags?

2001-09-13 Thread Critter

Hello Will,


0.02
Custom  tags are called in their own memory space, so their execution is not quite as
fast as udf's (I believe)



-- 
Critter, MMCP
Certified ColdFusion Developer

Crit[s2k] - CF_ChannelOP Network=Efnet Channel=ColdFusion
---
Thursday, September 13, 2001, 10:14:43 AM, you wrote:

WR Hello All,

WR   I need some clarification, what is the difference between a UDF  a Custom
WR Tag?  Are they stored  called the same way?

WR -TIA
WR  Will
WR
~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
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