Re: How do you use UDFs in CF 5

2002-01-31 Thread one

I was looking at cflib.org at the various UDFs that can be downloaded.

However, I'm not aware of how you use the UDFs.

1. Do you place them in the root of the site you're working in or the custom
tags directory and

2. How do you call and use them as far as within your scripts.

I haven't had a chance to check the docs on CF 5 yet, so would appreciate
any feedback.

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



RE: How do you use UDFs in CF 5

2002-01-31 Thread Raymond Camden

 1. Do you place them in the root of the site you're working 
 in or the custom
 tags directory and

A UDF must be in the local scope. Think of it like a variable. I can't
cfoutput #x# unless I defined it earlier. Now, just like variables, UDFs
do not need to be on the same physical page. I can CFINCLUDE a
template that contains the UDFs, or define them in the Application.cfm
file.

 2. How do you call and use them as far as within your scripts.

They act just like BIFs, or built in functions. Consider:

!--- ArrayLen is a built in func ---
cfset foo = arrayLen(x)

!--- countIT is a udf 
cfset foo = countIt(x)

===
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 Your Own Dedicated Windows 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=coldfusionb
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: How do you use UDFs in CF 5

2002-01-31 Thread Jamie Jackson

Start by sticking them in the same page you're calling from (just to
get the hang of it):

cfscript
function sayHello (name) {
return 'Hello, '  name;
}
/cfscript
cfoutputsayHello('Joe')/cfoutput

Yields: Hello, Joe


But the best way is to stick all of your UDFs on one page, and include
the file in your application.cfm. Or, you can organize functions into
libraries.

Jamie


On Thu, 31 Jan 2002 09:27:48 -0800, in cf-talk you wrote:

I was looking at cflib.org at the various UDFs that can be downloaded.

However, I'm not aware of how you use the UDFs.

1. Do you place them in the root of the site you're working in or the 
custom
tags directory and

2. How do you call and use them as far as within your scripts.

I haven't had a chance to check the docs on CF 5 yet, so would 
appreciate
any feedback.

Thanks.

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



Re: How do you use UDFs in CF 5

2002-01-31 Thread Zac Spitzer

Raymond Camden wrote:

1. Do you place them in the root of the site you're working 
in or the custom
tags directory and


A UDF must be in the local scope. Think of it like a variable. I can't
cfoutput #x# unless I defined it earlier. Now, just like variables, UDFs
do not need to be on the same physical page. I can CFINCLUDE a
template that contains the UDFs, or define them in the Application.cfm
file.

does it make sense to map them to a REQUEST scope? :-)

z

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



RE: How do you use UDFs in CF 5

2002-01-31 Thread Carlisle, Eric

When you include lots of UDFs, is there a performance concern?  If I
download strLib from cflib.org (which has 81 UDFs), should I delete all 
the
UDFs that I don't plan to use? 




-Original Message-
From: Jamie Jackson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 12:27 PM
To: CF-Talk
Subject: Re: How do you use UDFs in CF 5


Start by sticking them in the same page you're calling from (just to
get the hang of it):

cfscript
function sayHello (name) {
return 'Hello, '  name;
}
/cfscript
cfoutputsayHello('Joe')/cfoutput

Yields: Hello, Joe


But the best way is to stick all of your UDFs on one page, and include
the file in your application.cfm. Or, you can organize functions into
libraries.

Jamie


On Thu, 31 Jan 2002 09:27:48 -0800, in cf-talk you wrote:

I was looking at cflib.org at the various UDFs that can be downloaded.

However, I'm not aware of how you use the UDFs.

1. Do you place them in the root of the site you're working in or the 
custom
tags directory and

2. How do you call and use them as far as within your scripts.

I haven't had a chance to check the docs on CF 5 yet, so would 
appreciate
any feedback.

Thanks.


__
Get Your Own Dedicated Windows 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=coldfusionb
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: How do you use UDFs in CF 5

2002-01-31 Thread Raymond Camden

 A UDF must be in the local scope. Think of it like a 
 variable. I can't
 cfoutput #x# unless I defined it earlier. Now, just like 
 variables, UDFs
 do not need to be on the same physical page. I can CFINCLUDE a
 template that contains the UDFs, or define them in the 
 Application.cfm
 file.
 
 does it make sense to map them to a REQUEST scope? :-)
 


I have in the past when I wanted to use a particular UDF in a custom
tag, although you can always do cfset x = caller.foo().

===
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 
__
Dedicated Windows 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=coldfusiona
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: How do you use UDFs in CF 5

2002-01-31 Thread Raymond Camden

 
 When you include lots of UDFs, is there a performance concern?  If I
 download strLib from cflib.org (which has 81 UDFs), should I 
 delete all 
 the
 UDFs that I don't plan to use? 

Loading any large amount of code that you don't plan on actually using
would be a bad idea. If you look at the source headers in the libraries
at cflib.org you would see us warning you about that. However, I don't
think you have to be extremely worried about it. 81 UDFs is quite a lot
if you only plan on using a few, so yes, I'd trim that library down to
what you need. 

===
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 Your Own Dedicated Windows 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=coldfusionb
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