Thanks, I was walking past the kitchen table and picked up a copy this
months cfdj and read Ben Forta's article. That got me to thinking how could
I put all of my function in one place and load them up only once per visit
to the web site and not cfinclude them on ever page. I wrote this cool
little custom tag that lets you pick your scope like session, application,
request and then the tag loops through the function names assigning them to
the that scope.

Now I am thinking about building a wizard like my custom tag wizard that
will let you go in an package all of your functions into a library by way of
a custom tag. What d-ya think.

Bryan

----- Original Message -----
From: "Dain Anderson" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Saturday, June 02, 2001 9:29 AM
Subject: Re: CF5 and UDF's


| Bryan,
|
| In UDF's, you can use the ArrayLen() function to check for the existence
of
| passed values:
|
| <CFSCRIPT>
| function mydate()
| {
|     var d = "";
|     if(ArrayLen(Arguments))
|         d = Arguments[1];
|     else
|         d = Now();
|     return DateFormat(d);
| }
| </CFSCRIPT>
|
| <CFOUTPUT>#mydate("01/01/2001")#</CFOUTPUT>
|
| Dain Anderson
| Caretaker, CF Comet
| http://www.cfcomet.com/
|
|
| ----- Original Message -----
| From: "Bryan LaPlante" <[EMAIL PROTECTED]>
| To: "CF-Talk" <[EMAIL PROTECTED]>
| Sent: Saturday, June 02, 2001 4:04 AM
| Subject: CF5 and UDF's
|
|
| > Is anyone playing with user defined functions? I can not find any doc's
on
| > the subject in cfdocs or in studio. I wander if there is a way to do
what
| I
| > am trying below
| >
| > <CFSCRIPT>
| > function mydate(){
| >  if (arguments is "")
| >   d = now();
| >   else
| >   d = arguments[1];
| >
| >  return DateFormat(d);
| > }
| > </CFSCRIPT>
| >
| > <CFOUTPUT>#mydate("01/01/2001")#</CFOUTPUT>
| >
| >
| >
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to