CFLib.org – Common Function Library Project

arrayAppend2D(aName, value1, value2)

Last updated March 21, 2006

author

Minh Lee Goon

Version: 1 | Requires: CF5 | 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 = ArrayNew(2)>
<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:

/**
 * 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;
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson