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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.