ColdFusion 9.0 Resources |
Using implicitly created arraysYou can use implicitly created arrays directly in functions (including user-defined functions) and tags. For example, the following code uses two implicit arrays, one in a ColdFusion function, the other in a user-defined function: <cffunction name="sumarray"> <cfargument name="inarray" type="array"> <cfset result = 0> <cfloop array="#inarray#" index="i" > <cfset result += i> </cfloop> <cfreturn result> </cffunction> <cfoutput> Summed Implicit array [#ArrayToList([1,2,3,4,5,6])#]: #sumarray([1,2,3,4,5,6])#<br /> </cfoutput> |