What would be the scope of a UDF then? say udf.foo or function.foo?
Bob Everland
-Original Message-
From: Raymond Camden [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 30, 2001 3:05 PM
To: CF-Talk
Subject: RE: Writing Custom Functions
Maybe I'm reading this wrong, but I have
To: CF-Talk
Subject: RE: Writing Custom Functions
Maybe I'm reading this wrong, but I have to ask - does this mean that
one
can, with CF5, set the code of a UDF into a variable, and then
execute that
UDF just by calling that variable in function syntax, and it
automatically
gets
As long as we're talking about variable scopes, is there a structure that I
can get access to that contains all local variables? That is, variables
that are in the variables scope. I have a debug routine at the bottom of
all my pages that displays all application,session,form,url,request,cgi
I am with ya. I have wanted that for a long time.
- Original Message -
From: Avi Flax [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Thursday, May 31, 2001 8:47 PM
Subject: Re: Writing Custom Functions
As long as we're talking about variable scopes, is there a structure that
I
Michael,
Maybe I'm reading this wrong, but I have to ask - does this mean that one
can, with CF5, set the code of a UDF into a variable, and then execute that
UDF just by calling that variable in function syntax, and it automatically
gets evaluated and run?
Is that all the function keyword
Your reading me correctly. A UDF is a 'system symbol' like any variable,
object reference, etc. This means it shows up in an IsDefined() call and
even has its own function (IsCustomFunction()). The example below shows a
simple UDF and it's aliases. One of which is a server variable.
CFSCRIPT
Maybe I'm reading this wrong, but I have to ask - does this mean that one
can, with CF5, set the code of a UDF into a variable, and then
execute that
UDF just by calling that variable in function syntax, and it
automatically
gets evaluated and run?
Yes. Consider this:
CFSCRIPT
PROTECTED]]
Sent: 25 May 2001 00:57
To: CF-Talk
Subject: Re: Writing Custom Functions
Sounds good! Who am I to argue with Ben Forta and Micheal Dinowitz!?!?
Looking forward to the UDF's at any rate... thanks for the info!
Steve
~~
Structure your ColdFusion
can you do inside UDFs?
Thanks
KOla
-Original Message-
From: Steve Reich [mailto:[EMAIL PROTECTED]]
Sent: 25 May 2001 00:57
To: CF-Talk
Subject: Re: Writing Custom Functions
Sounds good! Who am I to argue with Ben Forta and Micheal Dinowitz!?!?
Looking forward to the UDF's
* Team Allaire *
In CF 5 the answer is yes.
CFSCRIPT
function StringLimit(string, length)
{
if (len(string) GT 8)
return Left(lname, 8);
else
return string;
}
/CFSCRIPT
I already know the answer to this, but I
This is possible in ColdFusion 5 which will be released soon. For an set of
examples on UDF, see www.cflib.org.
===
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia
Email : [EMAIL PROTECTED]
ICQ UIN :
CF 5 will provide this capability.
- Original Message -
From: Steve Reich [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Thursday, May 24, 2001 14:48
Subject: Writing Custom Functions
I already know the answer to this, but I thought I would see what it might
inspire
Is
you can write a custom fuction in CF 5.0, just as if u were using javascript
or whatever.
From: Steve Reich [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Subject: Writing Custom Functions
Date: Thu, 24 May 2001 14:48:11 -0400
I already know the answer to this,
User-defined functions (UDFs) will be available in ColdFusion 5.0, which
should be released in the near future. The syntax will not allow you to call
tags from within the custom function, only cfscript elements and functions.
For example:
cfscript
function StringLimit(thestring,length) {
Awesome! Thanks Michael...! Will those user defined functions be included in
a global functions page or how are they accessed? Say you have 50 user
defined functions you wouldn't want to include them all, right?
Steve Reich
Michael Dinowitz [EMAIL PROTECTED] wrote in message
* Team Allaire *
The normal operation is to have your UDF either on the same page as you need
them or in a CFINCLUDE. If your especially evil then you can load them into
server or application variables in an initialization page and then use
.
-Original Message-
From: Michael Dinowitz [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 24, 2001 15:48
To: CF-Talk
Subject: Re: Writing Custom Functions
* Team Allaire *
The normal
The normal operation is to have your UDF either on the same page as you
need
them or in a CFINCLUDE. If your especially evil then you can load them
into
server or application variables in an initialization page and then use
them
as server.stringlimit('this is my string', 5). Using them in
* Team Allaire *
Why kill all the cool speed increase you get from a UDF by putting it in a
custom tag? A 'header library' is acceptable in most languages so putting
CFINCLUDE template=/cfide/library/libdebug.cfm
in the application.cfm is
the ones you want.
Kind of like including header file in C.
--- Ben
-Original Message-
From: Steve Reich [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 24, 2001 6:08 PM
To: CF-Talk
Subject: Re: Writing Custom Functions
The normal operation is to have your UDF either on the same page
What about putting them in a custom tag and then just calling the UDF's
you
need? You could have all of your UDF's in a single file and call them as
you
need them
cf_UDF
GetFunctions=StringLimit, IntegerCount,
MyGrandmasFavoriteCookieRecipe,
OneMoreFunction
That way, you could
Sounds good! Who am I to argue with Ben Forta and Micheal Dinowitz!?!?
Looking forward to the UDF's at any rate... thanks for the info!
Steve
~~
Structure your ColdFusion code with Fusebox. Get the official book at
22 matches
Mail list logo