mIRC Home    About    Download    Register    News    Help

Print Thread
Max size of hash table data #184582 30/08/07 01:15 PM
Joined: Apr 2006
Posts: 464
O
OrionsBelt Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
Does anyone know how many characters can be placed in an hash table data?

Basicly, I want to make a table that holds comments.
So: <table> <id> <comment>

But before storing this comment, I want to make sure, that it doens't exceed the maximum amount of characters the table can hold.
if ($len(%comment) < x) {

So, what's the max?
Or, what's a safe length to use?

Thanks smile

Re: Max size of hash table data [Re: OrionsBelt] #184583 30/08/07 01:20 PM
Joined: Jul 2006
Posts: 3,574
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,574
The length is different according to people but 930 is a safe length


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Max size of hash table data [Re: Wims] #184584 30/08/07 01:24 PM
Joined: Apr 2006
Posts: 464
O
OrionsBelt Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
Aight, 930 it is then laugh

Thx a lot Wims!

Re: Max size of hash table data [Re: OrionsBelt] #184585 30/08/07 01:32 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
My testing: $len(tablename + item + data) has to be <= 939
Code:
alias lentest {
hadd -sm $1 $2 $str(x,$3)
echo -a LEN: tablename $len($1) item $len($2) data $len($hget($1,$2)) total: $calc($len($1) + $len($2) + $len($hget($1,$2)))
 hfree $1
}

/lentest a a 937 >> LEN: tablename 1 item 1 data 937 total: 939
/lentest a a 938 >> line too long

/lentest aaa a 935 >> LEN: tablename 3 item 1 data 935 total: 939
/lentest aaa a 936 >> line too long

/lentest a ab 936 >> LEN: tablename 1 item 2 data 936 total: 939
/lentest a ab 937 >> line too long


...the max len of %vars is likely: $len(varname (including the % char) + data) has to be <= 942

Code:
alias lentest2 {
set -u $+(%,$1) $str(x,$2)
echo -a LEN: varname $len($var($+($1,*),1)) data $len($($var($+($1,*),1),2)) total: $calc($len($var($+($1,*),1)) + $len($($var($+($1,*),1),2)))
}

/lentest2 testing 934 >> LEN: varname 8 data 934 total: 942
/lentest2 testing 935 >> line too long

/lentest2 ab 939 >> LEN: varname 3 data 939 total: 942
/lentest2 ab 940 >> line too long

smile

Last edited by Horstl; 30/08/07 01:45 PM.
Re: Max size of hash table data [Re: Horstl] #184587 30/08/07 01:54 PM
Joined: Apr 2006
Posts: 464
O
OrionsBelt Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
lol!

Alright awesome, I wanna be sure that I won't have any problems, so I've limited it to 900 characters.
900 is quite sufficiant for a proper note, and I'm rather safe then sorry.

Thanks for your tests Horstl!

Re: Max size of hash table data [Re: OrionsBelt] #199817 22/05/08 06:01 AM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
*dump* laugh
As you may have noticed, new mIRC 6.32 brought about some alternation (extension) to these limits:
Originally Posted By: versions.txt
12.Standardized and extended string lengths throughout mIRC to allow the use of longer variables, channel and nick names, and other items.

FYI (and mine, of course) here are some of the *new* limits, according to my tests:

max hash len (tablename + item + data): v6.31: 939 - v6.32: 4140
max var len (varname(including the % char) + data): v6.31: 942 - v6.32: 4143
max line len (echo): v6.31: 942 - v6.32: 4143
max window name len (including @): v6.31: 90 - v6.32: 256

Last edited by Horstl; 22/05/08 06:09 AM.