Nov 23, 2006
User Defined Functions
Posted by: CFHow.com
Like most programming languages, ColdFusion lets you create your own functions. User defined functions or UDFs for short can be used anywhere on the page where they are located as if they were any other built in ColdFusion function. If you need to use a ColdFusion function on more than one page, consider keeping it in a component or an include file. Technically you could also keep it in the Application File and then you’d be able to access it from any of the applicable pages, but that can turn out really terrible, click here for the why.
In any event, user defined functions add a level of modularity to your programming which really adds to the scalability and manageability of your projects. In this article we’ll go ahead and create a really basic function for formatting a datetime object. Something like this can really come in handy on any sort of big report where might need to format a date time object in the same way in different places. Doing this in a UDF not only makes your code a little easier to read, but also makes modifications a lot simpler.
View the rest of the article on ColdFusion User Defined Functions CFHow.com!
Continuing the discussion
...
Comments
Post a Comment
Search
About The Author
Links
Recent Comments
-
鲜花:
<
THANKS
[View] -
National Marine Engineers Bene:
<
Hey, Thanks for letting us know!Cheers
[View] -
Ahamad:
<
Hi, May be you would be interested in the c...
[View] -
Vick:
<
These blogs are really interesting and contai...
[View] -
Lolsy:
<
Thanks for the article!
[View] -
Kola:
<
Very ineresting article. Thanks!
[View] -
Kesha:
<
Thanks for the useful links!
[View] -
Kesha:
<
It's a real workable stuff. Thanks!
[View] -
Milla:
<
thanks for information! great work man
[View] -
Anonymous:
<
ColdFusion rocks:)It's a real workable stuff,...
[View]