Macromedia ColdFusion MX 7 Certified Developer Study Guide

You can define a function in the following places:

  • On the page where it is called, as long as it's declared before it's used

  • On a page where the UDF is included by using a <cfinclude> tag

Creating a function within one application page might be useful if you want the code to be organized and readable. It is accessible only from the page on which it is declared, and it must be declared before it is used.

You can create many functions within one CFML page. Therefore, you can create a library of functions that can be used throughout an application or within a subset of application pages. It is useful to group commonly used functions into separate files to be included when needed.

Категории