Although it sounds good to use hash tables for all of your settings, keep in mind that many large hash tables will use resources and saving them can "freeze" mIRC for a noticeably period of time if the table(s) are large. Hash tables are great and they are fast. However, that doesn't mean they are the best method every time. For settings that aren't used frequently, a settings file, or even variables, is more appropriate.

This is a major issue with Invision because it has different settings for each network a user is on and just being on 3 networks can generate around 200 hash tables of settings. They aren't huge tables, but there are many of them and saving the settings can "freeze" you for 5-10 seconds. Most of those settings aren't even used most of the time, so there's no reason to have them in a hash table to begin with. This will eventually be changed whenever I get around to it (it's a big job), but for now it can be troublesome.

Anyhow, that example shows one reason why it's best to not use hash tables indiscriminantly. Use them when it makes sense rather than all of the time. If you don't check the settings frequently, then the occasional $read/$readini isn't going to be a problem considering you're freeing up resources throughout the entire time that you are running the script by not using the hash table.

That's just my opinion (I *do* love hash tables, btw), but you can choose whichever method you prefer.


Invision Support
#Invision on irc.irchighway.net