mIRC Home    About    Download    Register    News    Help

Print Thread
#184582 30/08/07 01:15 PM
Joined: Apr 2006
Posts: 464
O
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

Joined: Jul 2006
Posts: 4,134
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,134
The length is different according to people but 930 is a safe length


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Apr 2006
Posts: 464
O
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
Aight, 930 it is then laugh

Thx a lot Wims!

Joined: Nov 2006
Posts: 1,559
H
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.
Joined: Apr 2006
Posts: 464
O
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!

Joined: Nov 2006
Posts: 1,559
H
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.

Link Copied to Clipboard