mIRC Homepage
Posted By: NightChillz hash tables(info plz) - 28/12/02 07:51 PM
hey,just wondering how hash tables sorts the items and data in them, are they sorted in order from,:
1 = 1st added
2 = 2nd added
3 = 3rd added
etc etc

or ?
Posted By: Hammer Re: hash tables(info plz) - 28/12/02 10:07 PM
They are not sorted at all. To show this, I typed the following:
Code:

/hmake test 10
/hadd test 3 First entry
/hadd test 1 Second entry
/hadd test 2 Third entry
//var %i = 1 | while ($hget(test,%i).item) { echo -ati2 * $ifmatch = $hget(test,$ifmatch) | inc %i }
* 2 = Third entry
* 3 = First entry
* 1 = Second entry
Posted By: NightChillz Re: hash tables(info plz) - 28/12/02 10:26 PM
ok, i just wanted to know if they were "sorted" by the order they were added to the table, guess not tho :P
Posted By: Online Re: hash tables(info plz) - 28/12/02 11:23 PM
A $hsort identifier was suggested in the old suggestions board. Let's hope K does something about it.
© mIRC Discussion Forums