mIRC Home    About    Download    Register    News    Help

Print Thread
#171529 25/02/07 03:42 PM
Joined: Dec 2006
Posts: 31
K
klaaamp Offline OP
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Dec 2006
Posts: 31
If I do a whileloop, with $readini, will it read from the file every time or from memory, read something that inifiles are cached in memory...

klaaamp #171530 25/02/07 03:53 PM
Joined: Jan 2007
Posts: 280
Fjord artisan
Offline
Fjord artisan
Joined: Jan 2007
Posts: 280
$read(the ini)

Mean that?


Last edited by DuXxXieJ; 25/02/07 03:53 PM.

Squee whenever a squee squee's. Squee whenever a squee does not squee.
klaaamp #171547 25/02/07 04:59 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I believe that only timers "cache" stuff in the way you're talking about. A while loop will re-read the data every time you go through. This can make for a slow script if you don't need to read it every time. For that reason, it's often good to put the read/readini into a variable before the while starts and then use the variable as needed in the loop so it's read only once. Depending what you're doing in the loop, this may or may not be possible, though.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #171560 25/02/07 07:56 PM
Joined: Dec 2006
Posts: 31
K
klaaamp Offline OP
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Dec 2006
Posts: 31
Originally Posted By: Riamus2
I believe that only timers "cache" stuff in the way you're talking about. A while loop will re-read the data every time you go through. This can make for a slow script if you don't need to read it every time. For that reason, it's often good to put the read/readini into a variable before the while starts and then use the variable as needed in the loop so it's read only once. Depending what you're doing in the loop, this may or may not be possible, though.


too bad, dont get though what flushini is for and when it actually dont read it from file, a good feature for mirc would be to add a switch to the readinivariable like -m so it only read from memory, in that way it would be awsome way to speed up advanced scripts that cant be done with hashtables...

klaaamp #171599 26/02/07 02:14 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
A hash table can do anything an INI can do. You *may* need more than one depending what you're trying to do, but hash tables still can do the same things.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard