Wednesday, April 9, 2008

Tag-based user defined functions_2

ColdFusion MX introduces a new CFFUNCTION tag for creating user-defined functions (UDFs)

containing CFML tags, which means that you can now declare your own functions that use

databases, external systems, or anything else accessible by the ColdFusion language.

Functions declared with CFFUNCTION are more formally structured than their CFSCRIPT UDF

counterparts. CFFUNCTION formally defines the data type that it returns as the result of the

function, and a new child tag—CFARGUMENT—formally defines the names and data types of

the arguments passed into the function, as well as whether those arguments are required or

optional.

The new CFINVOKE and CFINVOKEARGUMENT tags provide a new way to invoke user-defined

functions. Functions can now be invoked through a formally declared interface into the function's

arguments, and those arguments can now be declared as either required or optional.

0 comments: