UDF Positioning

Every ColdFusion developer is familiar with the use of functions. We use them regularly to do things like changing the case of a string with LCase() or UCase() and performing regular expression replacements with REReplace().

ColdFusion 5 introduced UDFs to CFML. A UDF is simply a piece of CFScript that establishes a function that doesn’t exist in the collection of ColdFusion functions. The new function can then be used within other CFScript blocks. This is a powerful extension to ColdFusion, but it’s not without its pitfalls. We can create a proper UDF only to get an error when we try to use it. To make successful use of UDFs, we need to understand how to make them available to our code.

When UDFs Are Available

UDFs are typically ...

Get Fusebox: Developing ColdFusion® Applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.