mIRC Home    About    Download    Register    News    Help

Print Thread
#64142 15/12/03 11:31 PM
Joined: Oct 2003
Posts: 14
Q
qFox Offline OP
Pikka bird
OP Offline
Pikka bird
Q
Joined: Oct 2003
Posts: 14
thats it basicly, a request to be able to sort hashtables (the default sorting method that custom windows and nicklist uses is fine for me).

also (or as an alternative...), make an option for /hadd (and /hinc /hdec etc) to add the item sorted (so insert b after the a and before the c, rather then at the end), this way you can make sure yourself the table is consistent, so you wont have to sort it all the time (if this becomes possible smile)

thanks :tongue:
qFox

Joined: Nov 2003
Posts: 227
H
Fjord artisan
Offline
Fjord artisan
H
Joined: Nov 2003
Posts: 227
I would like to see some additions to the options for hash tables too, since you opened the thread, a flag for hmake to make a hash tables items case sensitive i think would be good and probably simple for Khaled to add, I've needed this in the past, but had to script around it making the script slower. Then something like $hget(name).type would probably have to be added so you could see if it was a normal table or case sensitive.

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
qFox:
Hash tables aren't meant to be accessed in a sorted fasion. They are made to be easily (and most important) quickly. Sorting a hash table completly defeats the purpose of having them (imo).

Hitchhiker:
I'm not sure about having a type-specific table, but I think switches would be nice. Such as $hget(table, FiNd).cs for Case Sensative, or some other flag. I see more need for a table that supports both, than one thats either or.


-KingTomato
Joined: Nov 2003
Posts: 227
H
Fjord artisan
Offline
Fjord artisan
H
Joined: Nov 2003
Posts: 227
if you where to do something like:
Code:
//hadd -m test A test | hadd test a test | echo -a $hget(test,0).item

the first item is over written, so I think its more of a thing that would have to be done during /hmake not $hget. some times it would be nice to have Case Sensitive variables too, but i can see lots of reasons to why that would cause many problems, but I think hash tables would be a good place to store and recover info in a case sensitive way.

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
/hmake test
/hadd -c test A test
/hadd -c test a test

Use -c as a flag for "Pay attention to case"


-KingTomato
Joined: Apr 2003
Posts: 210
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Apr 2003
Posts: 210
Quote:
Hash tables aren't meant to be accessed in a sorted fasion. They are made to be easily (and most important) quickly. Sorting a hash table completly defeats the purpose of having them (imo


Agreed. But still, The desire for a feature similair to hash tables in functionality, With the ability to sort, etc, is there.

And a scripted solution is not good enough.

Joined: Oct 2003
Posts: 14
Q
qFox Offline OP
Pikka bird
OP Offline
Pikka bird
Q
Joined: Oct 2003
Posts: 14
exactly. it might not be your purpose, but it is my purpose in this particilour case. i'll probably revert to mysql now.
on that note, khaled could you build in some mysql support? or at least a dbconnect and query send/receiver? tnx :tongue:


Link Copied to Clipboard