Organizing UDFs


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.



Macromedia ColdFusion MX 7 Certified Developer Study Guide
Macromedia ColdFusion MX 7 Certified Developer Study Guide
ISBN: 0321330110
EAN: 2147483647
Year: 2004
Pages: 389
Authors: Ben Forta

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net