mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 11
M
MrCPU Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Jan 2003
Posts: 11
Hi,

I have a problem on my old laptop.
I have write a little script, where I can search channels in on an ini-file.

The script use an ini-file with at this time 1250 lines, but when I want to read an entry behind line 1020 the $readini returns $null.

The laptop have 100 MHz 80 MB Ram and 4GB HDD.
OS is Win98SE with an Uptime of 7 weeks.

Why returns the script at behind line 1020 of the ini-file only $null?
At my main pc all works fine, but there...

Anyone an idea? What can I do?

Bye MrCPU

sorry for my english, it is not so good wink

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
May have hit the 64k limit.. Most likely a windows limitation, rather than mirc.


-KingTomato
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
mIRC uses Windows' functions to manipulate INI files, and what you've experienced could be a limitation. I used this code to create a huge test.ini file,
  • //fopen -no a test.ini | .fwrite -n a [section] | var %i = 1 | while %i <= 10000 { .fwrite -n a item $+ %i $+ =value $+ %i | inc %i } | fclose a
and $readini failed around item3300. You can still read from the file using $read(file,wn,item=*) that returns the full line.

Joined: Jan 2003
Posts: 11
M
MrCPU Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Jan 2003
Posts: 11
Hi,

thx, at this time the ini file have a size of 20kb and there are 446 sections with total 453 items, also not to many...

I will test it with $read...
It's sort of weird.

Bye MrCPU

Joined: Jan 2003
Posts: 11
M
MrCPU Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Jan 2003
Posts: 11
Hi,

I have test it with the read.
On my system all works very good, but on the laptop, the same problem like $readini.
$read only return the line if it is befor 1020.
I don´t understand it... frown

Bye...

Joined: Oct 2003
Posts: 3
C
Self-satisified door
Offline
Self-satisified door
C
Joined: Oct 2003
Posts: 3
Can I ask what the script is trying to save to INI, that you're making?

1000 lines is a lot of data -- you may want to do what I did for large storage --

I switched to mIRC's hashlists for storage of settings and data I wanted to access -- it's a bit more to learn, but they work SO much faster. than INI files do.

I'm using my hashlists for keeping up a proxy blacklist for a channel I op in, and it has around 5000 to 7000 entries now.

In addition to that, I was using an older machine with this -- a 5 year old K6-2 (266mhz) machine, and it performed quite well with a list that large ...
1000 entries would be that much quicker, and still relatively fast even on a 100mhz machine.

Since hashes are stored in RAM, they're very quick -- and there/s the /hsave /hload routines to save your hashlist to a file, so that you can quickly Save and Restore your data so it's accessible in your script.

I'd really encourage you to look into using another structure to hold your data -- you don't want to transfer a bathtub full of water using a teacup, when you can use a bucket.

ChrstphrR

Joined: Jan 2003
Posts: 11
M
MrCPU Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Jan 2003
Posts: 11
Hi,

I save a list of channels for the alliances of a browsergame where I make support.

in the game you can se the ally-tag for the ally, like
GoH = Guards of Honor
and many players come in the channel and ask:
Anybody know the channel of GoH?
And then the script will answer like
You are searching the channel for GoH: #guardsofhonor @gamesnet

The ini file is so:
[GoH]
Channel=#guardsofhonor @gamesnet

The Script reads the section and say the channel to the user.
Now in over one year there are in the ini file more than 300 ally-chans with over 400 entrys.

I think the ini-file is here the easiest way to handle that.

I have make some tests with $readini and $read and now I have change the file and the script an I work with $read that seach the [...] in the file and one entry now is like an ini, but in one line:
[GoH] Channel=#guardsofhonor @gamesnet
so I can search the [...] and than the script write the complete line to he user.

So I have 400 lines in the file and it works, but if there are more than 1020 line, all behind will ignored...

Bye

Sorry for my english... (I don´t like it) :tongue:


Link Copied to Clipboard