Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting a key-value Structure 2

Status
Not open for further replies.

capitano

Programmer
Joined
Jul 30, 2001
Messages
88
Location
US
Does anyone know how to sort a structure?
I have an associative array type structure
(key)(numeric value)
(key)(numeric value)
(key)(numeric value)
...
...
etc.

I want to sort the keys by their numeric value.

I'm working with ColdFusion 4.0 and so I don't have the
luxury of using the StructSort() function which is available in ColdFusion 5.0

Please Help!
 
I don't know 4.0 very well but I'm guessing you could turn the numeric-keyed structure into an array, right? Just go through each structure element (however you do that in 4.0) and add it to an array. I'm guessing 4.0 came complete with array sorting functions.

Hope that helps, I have read that 4.0 wasn't very helpful in the structure department.
 
Thanks, that was helpful. But now I have a 2D Array which I don't know how to sort. Looking through CFML docs and online posts, I don't think ColdFusion4.0 has ArraySort() functions which work with anything but 1-Dim Arrays.

AAARRRRGGG!!!

I've heard there may be some custom tags at Allaire? Does anyone know the URL for this? I can't seem to locate them on the Allaire/Macromedia website.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top