arrayAppend2D(aName, value1, value2)
Last updated March 21, 2006
Version: 1 | Requires: ColdFusion 5 | Library: DataManipulationLib
Description:
This UDF appends allows the user to append a key-value set to a two-dimensional array. The code is easily modifiable for more than two dimensions.
Return Values:
Returns the array.
Example:
<cfset aSideNav[1][1] = "New Project">
<cfset aSideNav[1][2] = "project.cfm?ID=0">
<cfset aSideNav = arrayAppend2D(aSideNav, "Bid Results", "bidresults.cfm")>
Parameters:
| Name | Description | Required |
|---|---|---|
| aName | The array. | Yes |
| value1 | First value. | Yes |
| value2 | Second value. | Yes |
Full UDF Source:
<cfscript>
/**
* Appends two values to a 2D array.
*
* @param aName The array. (Required)
* @param value1 First value. (Required)
* @param value2 Second value. (Required)
* @return Returns the array.
* @author Minh Lee Goon (contact@digeratidesignstudios.com)
* @version 1, March 21, 2006
*/
function arrayAppend2D(aName, value1, value2) {
var theLen = arrayLen(aName);
aName[theLen+1][1] = value1;
aName[theLen+1][2] = value2;
return aName;
}
</cfscript>
Search CFLib.org
Latest Additions
Tayo Akinmade added
arrayTrim
11 day(s) ago
Will Belden added
longTime
17 day(s) ago
James Sleeman added
quickSort
27 day(s) ago
Ben Forta added
GetHostAddress
30 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)