This is actually really simple, but I stumbled across it, so I figured I would throw it up here:
If you have an array or list of text string elements that you want to sort alphabetically, ColdFusion has a built in function for just that - ArraySort or List Sort
Note: ArraySort only works with one dimensional arrays. If you have multi-dimensional arrays that you want to sort, you should first concatenate the columns into one delimited list to store in a one dimensional array. In other words, if you have:
MyArray = ArrayNew(2);
MyArray[1][1] = "x";
MyArray[1][2] = "hello";
... you will need to change this to:
MyArray = ArrayNew(1);
MyArray[1] = "x,hello";
... or something along those lines. Ok, so back to the task at hand. Sorting lists or one dimensional arrays is very simple. See the code below:
<cfscript>
MySortedList = ListSort("x=hello&a=1&c=3&b=2", "textnocase", "ASC");
MyArray = ArrayNew(1);
MyArray[1] = "x=hello";
MyArray[2] = "a=1";
MyArray[3] ="c=3";
MyArray[4] = "b=2";
MySortedArray = ArraySort(MyArray, "text", "DESC");
</cfscript>
Here is some Adobe ColdFusion documentation on this matter: http://livedocs.adobe.com/coldfusion/7/htmldocs/00000397.htm
Hope that is useful to some one.