mIRC Home    About    Download    Register    News    Help

Print Thread
#72664 24/02/04 01:16 PM
C
ChosenOne
ChosenOne
C
Code:
//var %i = 1 | while (%i <= 10) { hadd -m test %i test | inc %i } | echo -a $hget(test,1).item | hfree test

Gives me "3".....always.
Why?
Shouldn't it be 1?
Please help me, maybe I overlooked something.

Thanks in advance.

Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
The problem is that hash tables don't store items in any specific order (at least, not any order that is relevant or useful to us), and by using the .item property of $hget() you've told mIRC that the item you've given is actually a numeric index rather than an item name.

Joined: Apr 2003
Posts: 413
A
Fjord artisan
Offline
Fjord artisan
A
Joined: Apr 2003
Posts: 413
KingTomato wrote:
Has tables use whatever available memory they can. Saving them is a matter of finding an empty location in memory (or paging file) and putting it there. Exporting just does through the memory locations and exports it. You're dealing with very large memory cell locations, not lines in a text file.

Joined: Jan 2003
Posts: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
And of course, excuse the typos wink


Link Copied to Clipboard