[thelist] Sorting 2D Array in ColdFusion

Michael Buffington mike at price.com
Tue Nov 28 15:26:29 CST 2000


I need to sort values in a 2D ColdFusion array.

By itself, this is a simple task, but it get's tricky. I'm converting a text
file that looks like this...

2303,3
2390,1
2302,2

...into a 2D array that looks like this:
col1 col2
2303 3
2390 1
2302 2

My intent is to sort the values to look like this:
col1 col2
2390 1
2302 2
2303 3

I cannot use ArraySort(myArray[2]) because that will only sort col2.  

Any ideas?

I may have to back track a good distance and loosen my dependence on this
data structure, but I can't think of an alternative just yet.

Michael Buffington
mike at price.com
(714) 556-3890 x222
http://www.price.com 
http://www.michaelbuffington.com




More information about the thelist mailing list