mIRC Homepage
Posted By: trenzterra Multiple variable file? - 23/09/03 03:41 AM
My variable file is very big now, already 9.3k, I would suggest an option to have multiple variable files.

Also, how big can variable files go to?
Posted By: sparta Re: Multiple variable file? - 23/09/03 04:36 AM
I must ask what you have in that file? and why so many %var's ? i have a full script configured and everything, and it isnt that big, and i have everything "almost" made true %var.
Posted By: MrPeepers Re: Multiple variable file? - 23/09/03 04:41 AM
That wouldnt seem practical to me, scripts would be messed up trying to figure out which variable file to try to read, and lets hope it would have more then one variable file loaded or else scripts with the same variable would be set off by other scripts. Also, how would you call upon these variables?
Posted By: trenzterra Re: Multiple variable file? - 23/09/03 04:43 AM
the variables will be called as normal, same as you have multiple script files.
Posted By: MrPeepers Re: Multiple variable file? - 23/09/03 04:49 AM
so in 4 different scripts I would call for %room yet in one script it assigns it as the current room Im in and in another script it assigns what room I just left and lets say in a third It assigns all the nicks in a certain room to that variable, how would I get around all that? Wouldnt it be easier to just skim down your variable file and make sure some arent just old ones set by scripts you have unloaded.
Posted By: pheonix Re: Multiple variable file? - 23/09/03 08:30 AM
how about you delete some variables and learn.
/help $readini
/help $read
/help /write
/help /writeini
/help hashtables
/help Local Variables
Posted By: trenzterra Re: Multiple variable file? - 23/09/03 10:32 AM
How about those information I need to get access quickly. I know hash tables are a nice alternative, but I can't access them as quickly as mIRC Script Editor>Variables.

Posted By: trenzterra Re: Multiple variable file? - 23/09/03 10:34 AM
Do what mIRC does and leave only the first one.
Posted By: pheonix Re: Multiple variable file? - 23/09/03 10:47 AM
hash table managers arent hard to make.
/help $hget
/help dialogs
Posted By: starbucks_mafia Re: Multiple variable file? - 23/09/03 10:57 AM
There's no functional reason as such that I can see why mIRC couldn't have multiple variable files, but the question becomes 'why would you need them?'. You're at 9.3k right now, has variable storage/retrieval become buggy? Which file would variables be assigned to? Even if the standard ini file storage has limitations (there used to be a 64k limit, not sure if that's still true), you don't need to store them in an ini. My variables are all stored in a separate .mrc file by themself and I'm reasonably sure mIRC wouldn't impose a limitation on that.

But do you really need 9.3k of variables? Global variables are the 'messiest' means of storage available. In another post here you mentioned your script was made of many modules, using a global variable for modules could quite easily lead to variable 'contamination' where two modules use the same variable name. You might find it more manageable if you grouped your data into hash tables - there's no meaningful performance difference for most things, it lessens the chance of name clashes between modules, and it can provide added functionality for certain types of data ($hfind()).
Posted By: LocutusofBorg Re: Multiple variable file? - 23/09/03 02:44 PM
Quite frankly I'm still baffled by the sheer amount of variables - what possible reason could you have for so many. I run a bot, full protection scripts, the works, and it has less than 20 permanent variables, everything else is local.
Posted By: starbucks_mafia Re: Multiple variable file? - 23/09/03 03:53 PM
Well he said the file was 9.3KB, so that could easily work out to about 50 variables at around 190 characters each. Even 9300 variables is entirely possible if someone used global variables for everything. For example an MP3 player script which stored a playlist in global variables could take up hundreds or thousands of variables in itself, or a bot that calculated detailed channel statistics at runtime could quite easily reach those sorts of figures. Of course both those things would make a lot more sense as hash tables. Personally I have only 2 global variables, and that's only because the code that uses them was written back when I first learned to script and I haven't bothered to update it.
Posted By: LocutusofBorg Re: Multiple variable file? - 23/09/03 05:29 PM
Both those things would also make a lot more sense NOT store in variables.
© mIRC Discussion Forums