How do I sort a single dimension array?
Use the built in ColdFusion arraySort() function.
<cfset arr = arrayNew(1)>
<cfset arr[1] = "beta">
<cfset arr[2] = "bar">
<cfset arr[3] = "foo">
<cfset arr[4] = "alpha">
<!--- sort array ascending alphabetically --->
<cfset isSuccessful = ArraySort(arr, "textnocase", "asc")>
<cfdump var="#arr#">
This question was written by Jeremy Petersen
It was last updated on May 8, 2006.