Adobe COLDFUSION 9 Manual page 126

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
The CFML Programming Language
Example
public String foo(array a)
{
for(var item in a)
{
writedump(item);
}
}
var declaration within for loop
Note: This feature applies only if you have installed ColdFusion 9 Update 1.
You can use
inline with for-in construct to bind variable to the local scope for both structs and arrays.
var
Example
public String foo(struct s)
{
for(var item in s)
{
writedump(item & ": " & s[item]);
}
writedump(local);
}
For arrays example, see
"for-in construct (for
Defining components and functions in CFScript
ColdFusion supports the syntax for defining CFCs, including interfaces, functions, properties, and parameters entirely
in CFScript. Currently, however, only certain ColdFusion tags are supported as CFScript functions. This section
describes the component definition syntax.
For information on tags as functions see
Basic Syntax
Syntax for defining a component is as follows:
/**
* ColdFusion treats plain comment text as a hint.
* You can also use the @hint metadata name for hints.
* Set metadata, including, optionally, attributes, (including custom
* attributes) in the last entries in the comment block, as follows:
*@metadataName metadataValue
...
*/
component attributeName="attributeValue" ... {
body contents
}
The following example shows a simple component definition
arrays)" on page 120.
"Tag equivalents in
CFScript" on page 109.
Last updated 8/5/2010
121

Advertisement

Table of Contents
loading

Table of Contents