Array([paramN])
Last updated July 3, 2002
Version: 1 | Requires: ColdFusion 5 | Library: DataManipulationLib
Description:
Now you can make simple or complex arrays with a one-liner in CF, just like with built-in shorthand syntax in many other programming languages. You can create simple 1D arrays with ease, or nest Array() functions to create complex 2D, 3D etc arrays.
Return Values:
Returns an array.
Example:
Parameters:
| Name | Description | Required |
|---|---|---|
| paramN | This UDF accepts N optional arguments. Each argument is added to the returned array. | No |
Full UDF Source:
<cfscript>
/**
* This functions helps to quickly build arrays, both simple and complex.
*
* @param paramN This UDF accepts N optional arguments. Each argument is added to the returned array. (Optional)
* @return Returns an array.
* @author Erki Esken (erki@dreamdrummer.com)
* @version 1, July 3, 2002
*/
function Array() {
var result = ArrayNew(1);
var to = ArrayLen(arguments);
var i = 0;
for (i=1; i LTE to; i=i+1)
result[i] = Duplicate(arguments[i]);
return result;
}
</cfscript>
Search CFLib.org
Latest Additions
Tayo Akinmade added
arrayTrim
4 day(s) ago
Will Belden added
longTime
9 day(s) ago
James Sleeman added
quickSort
19 day(s) ago
Ben Forta added
GetHostAddress
22 day(s) ago
Top Rated
EksporSQLData
Rated 5.0, 16 time(s)
backupDatabase
Rated 5.0, 13 time(s)
indentXml
Rated 5.0, 10 time(s)
generateSsccAsn
Rated 5.0, 4 time(s)