• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 5. Reusing Code > User-Defined Functions (UDFs)

User-Defined Functions (UDFs)

Macromedia added the concept of UDFs in ColdFusion 5.0. This was done after numerous requests from developers who wanted to create their own functions in a way that was similar to how developers created functions in other languages. With ColdFusion MX, Macromedia has added a new functionality to UDFs to make them easier to work with and more robust. They are also allowing developers to create UDFs in CFML instead of in only CFScript.

Before we move into how to create UDFs, let’s go over a few reasons why we would want to use UDFs. As a developer, you often find yourself creating ColdFusion scripts that basically do the same thing over and over again. Often, these scripts have at their core simple functions or algorithms that you usually just cut and paste into your code, because creating an actual ColdFusion tag doesn’t seem to be worth the time.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint