Returns the specified one-dimensional array with elements numerically or alphanumerically sorted.
ArraySort(array, sort_type [, sort_order ])
Name of the one-dimensional array that you want to sort.
The type of sort to execute. Sort type can be:
numeric -- Sorts numericallytext -- Sorts text alphabetically, uppercase before lowercasetextnocase -- Sorts text alphabetically; case is ignoredThe sort order you want to enforce:
asc -- (Default) Ascending sort orderdesc -- Descending sort order<!--- This example shows ArraySort --->
<HTML>
<HEAD>
<TITLE>ArraySort Example</TITLE>
</HEAD>
<BODY>
<CFQUERY NAME="GetEmployeeNames" DATASOURCE="HRApp">
SELECT FirstName, LastName FROM Employees
</CFQUERY>
<!--- create an array --->
<CFSET myArray=ArrayNew(1)>
<!--- loop through the query and append these names
successively to the last element --->
<CFLOOP query="GetEmployeeNames">
<CFSET temp= ArrayAppend(myArray, "#FirstName# #LastName#")>
</CFLOOP>
<!--- show the resulting array as a list --->
<CFSET myList=ArrayToList(myArray, ",")>
<!--- sort that array descending alphabetically --->
<CFSET myAlphaArray=ArraySort(myArray, "textnocase", "desc")>
...