ArraySum() - get sum of values in an array
ArraySum.cfm
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ArraySum function example: how to get sum of values in an array</title>
</head>
<body>
<h2 style="color:Green">ArraySum Function Example</h2>
<cfset NumberArray = ArrayNew(1)>
<cfset Temp = Arrayprepend(NumberArray,10)>
<cfset Temp = Arrayprepend(NumberArray,20)>
<cfset Temp = Arrayprepend(NumberArray,30)>
<cfset Temp = Arrayprepend(NumberArray,40)>
<cfdump var="#NumberArray#" label="NumberArray">
<br />
<cfoutput><b>NumberArray[Sum]: #ArraySum(NumberArray)#</b></cfoutput>
</body>
</html>
- ArrayAppend() - add element at the end of an array
- ArraySort() - sort array elements
- ArraySwap() - swap array values of an array at specified positions
- ArrayToList() - convert an Array to a List
- ListToArray() - copy the elements of a List to an Array
- ArrayNew() - three dimension array
- ArrayNew() - two dimension array
- cfdump - dump an array