mIRC Home    About    Download    Register    News    Help

Print Thread
#109432 29/01/05 04:36 PM
Joined: Feb 2004
Posts: 119
D
da_hype Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Feb 2004
Posts: 119
is there a way to sort the items (not data) in a hash tables?

#109433 29/01/05 07:07 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
See qwerty's reply in this thread.

#109434 31/01/05 02:35 AM
Joined: Jan 2005
Posts: 10
R
Pikka bird
Offline
Pikka bird
R
Joined: Jan 2005
Posts: 10
I was able to sort a hash table by asigning numbers to the items in it. Depends on how do you want to sort I guess.

Code:
 
var %i = 1
    while (%i <= $hget(helpreqs,0).item ) {
      hadd -s helpreqs %i $hfind(helpreqs,(%i + 1)).data
      hdel -s helpreqs (%i + 1)
      inc %i
    }
 


I belive you can parse the item or data into another variable and then sort it.


Link Copied to Clipboard