What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [?] Sort array by keys...

[?] Sort array by keys...
Author: Message:
Adeptus
Senior Member
****


Posts: 732
Reputation: 40
Joined: Oct 2005
RE: [?] Sort array by keys...
This kind of a collection is called an associative array or a hash.

What you do is take all your keys and put them as values in another array, which you can then sort.  Then you iterate through the sorted key values and use them as index to the original array, the net result being iterating the original array ordered by the keys' values.  If you want the original array permanently sorted, you can rebuild it while doing this.

For an example, see here.

07-23-2010 07:12 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[?] Sort array by keys... - by whiz on 07-23-2010 at 06:30 PM
RE: [?] Sort array by keys... - by roflmao456 on 07-23-2010 at 07:01 PM
RE: [?] Sort array by keys... - by Adeptus on 07-23-2010 at 07:12 PM
RE: [?] Sort array by keys... - by Eljay on 07-23-2010 at 07:13 PM
RE: [?] Sort array by keys... - by whiz on 07-23-2010 at 07:18 PM
RE: [?] Sort array by keys... - by Matti on 07-30-2010 at 07:47 PM
RE: [?] Sort array by keys... - by whiz on 07-31-2010 at 09:46 AM
RE: [?] Sort array by keys... - by Matti on 07-31-2010 at 12:56 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On