mIRC Home    About    Download    Register    News    Help

Print Thread
variable file, dialog line #268635 31/03/21 11:48 AM
Joined: Dec 2019
Posts: 43
Q
quartz Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Dec 2019
Posts: 43
variable file with 2000 lines


reading from line 1 2000 times, it does it in 3,300 loops/sec
reading from line 2000 2000 times, it does it in 2,700 loops/sec

this is a noticeable diff, can the order of variables be changed - so that ones used in "non-loop" scripts (the access time is not critical) are near the end, and ones used in loop scripts are near the start - it would make the loop scripts run faster

or can we have 2 variable files, one for eg static vars, one for 'dynamic' ones which are used in loops etc

reason for lots of variables - a dialog box with about 600 id's




also, when creating dialogs, this works


edit "text", $sect(entry), 20 150 50 20, tab 50


when combined with this

alias sect {

return $readini(C:\path\mIRC\defaults\scripts\diag.ini,sect,$1)

}


-- diag.ini is

[sect]
entry=500



this doesn't work

edit "text", $readini(C:\path\mIRC\defaults\scripts\diag.ini,sect,entry), 20 150 50 20, tab 50

so when making a dialog, $readini can't be used, but a custom identifier can be?

Last edited by quartz; 31/03/21 11:48 AM.
Re: variable file, dialog line [Re: quartz] #268636 31/03/21 02:32 PM
Joined: Jan 2004
Posts: 1,551
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,551
perhaps you can keep your variables in a hashtable which only requires the disk read when loading them at START, then again each time the dialog is closed if they need to be re-saved. Barring that, a better example of what you're doing could make it easier for someone to advise of optimizations, such as storing several variables in 1 string then performing fewer disk reads to load them all.

As for the 'order' of variables, if it's faster to read from [section1] that's at the front of the readme.ini than to read from [section99] toward the end, you can use notepad to cutpaste the heavily trafficked section to the front. I've never observed writeini rearranging the location of these [sections].

As for your problem with filling the editbox like that, the problem is not whether it's $custom or $built-in, the problem is whether the call contains commas. You'll find that $version and $sha1(abc) work just fine, but using instead $sha1(abc,0) fails. Probably because a simplistic parser is counting commas without consideration of whether they're inside the identifier call. The parser seems to only allow the comma when it's inside doublequotes, however nothing inside the doublequotes gets evaluated, even when you do something like " [ $sha1(abc,0) ] "