mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2005
Posts: 31
D
Div Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Aug 2005
Posts: 31
Hi all smile

Recently i'v been coding quite some extensive scripts, and alot are working with ini files;
now it has come to my attention that for some reason mIRC is hardcoded limited to 64k on ini files.

Could this be extended please? I don't know why the hardcode limit anyway, is it really needed for mIRC to properly function then?

If someone already got a way around this, i'll be happy to hear it! smile

PS: you can force 'try' to write to ini over 64k, but $readini it will still fail smirk

Thanks alot in advance for all replies on this matter, and I hope to see it altered soon smile

Last edited by Div; 15/09/07 02:20 PM.
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
The 64KB limit is not imposed by mIRC, but by the underlying Windows API routines that mIRC uses to access INI files.

As far as I know $readini() is capable of reading INI files over 64KB too if necessary (presumably using mIRC's own routines instead of the Windows API). Right now I just tested it with a 1.9MB INI and it's reading lines OK. You might want to upload your INI file and post a link here. That way maybe Khaled can figure out why $readini() can't read it.

If for whatever reason $readini() still can't read your long INI file then you could always create your own alias if necessary. You'd lose a bit more performance though, and ultimately the problem isn't going to go away. You might be better off redesigning your script to write data in a different way (perhaps storing it in hash tables that are loaded and saved to plain text files using /hsave and /hload).


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
Both of these worked just fine.


Code:

//var %i = 1 | while ($file(test.ini) < 1049600) { writeini -n test.ini test $+(test,%i) Item $+(test,%i) | inc %i } | echo -ea $readini(test.ini,test,$+(test,$ini(test.ini,1,0))) <--

-
test41224 <--
-

//var %i = 1 | while ($file(test.ini) < 1049600) { writeini -n test.ini $+(test,%i) test Section $+(test,%i) | inc %i } | echo -ea $readini(test.ini,$+(test,$ini(test.ini,0)),test) <--

-
Section test28968 <--
-




~ Edit ~

mIRC 6.3 / WinXP Pro SP2

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I don't know what you're doing with your scripts, but having INI files that large most likely means that the scripts could be improved. INI files (files in general) are a bad way to handle large amounts of data. Hash tables are much faster and work better in the majority of situations.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard