Originally Posted By: Horstl
Hash tables are inherently unsorted. If you search the forums a bit, you'll find several post like this.


I had searched, wasn't able to find anything.. oh well, will try harder next time ;_)

Quote:
As a cheap workaround, create your table with the size of 1 ("hmake hashtest 1" instead of "hmake hashtest %i") - although I forgot why, it will work. wink


It does work, although now it's in reverse order (which is at least *something* ;_))

And to the others: thanks for explaining. I didn't realize there was a reason for the unorderdness. I did know that replacing an item doesn't change it's position, although I somehow had hoped that new items would be added to the bottom of the table. Can't be helped.

Reason I use hashtables is mostly because it seems a bit more organized to me than global variables. It's funny though how first people told me I should use hashtables instead of dynamic vars, and now the other way around ;_) (no problem with vars of any kind (dynamic or not) btw, just prefer to not use them as globals).


http://zowb.net

/server -m irc.p2p-network.net -j #zomgwtfbbq
(ssl on port 6697 and 7000)