Ok, I had time to check your problem
bmc
You used Ini incorrectly. Ini_LoadKeys automaticaly appends section name on user prefix. As you used
Quote:
"cfg_" . A_LoopField . "_"
as a prefix, u doubled the prefix (well, maybe this is a bit of design isue which I will check later). Instead, your entire work is one line of code:
Code:
Ini_LoadKeys(ConfigFile, "", 0, "cfg_") ;notice the "" as section name
This will create global vars
cfg_SectionName_Key.
This also caused problem with MakeSection, as your globals where created as cfg_SectionName_SectionName_KeyName as both you and LoadKeys added SectionName. That made MakeSection to work improperly as later only first part of the prefix was removed.
I don't know why Dock variables poped up ... that doesn't happen here, and everything works normaly.
I made you a test script so you can see what is going on, with your own ini.
When you start it, it will open listvars and show you your globals. After that press F12 to iterate over sections and see all of them.
Using this example I noticed that LoadKeys should also return sections so
Code:
configSections := Ini_GetSectionNames(ConfigFile)
Ini_LoadKeys(ConfigFile, "", 0, "cfg_")
will be probably replaced with
Code:
configSections := Ini_LoadKeys(ConfigFile, "", 0, "cfg_")
Now LoadKeys returns number of variables created.
I will eventualy make Ini_MakeIni(prefix) that will scan for the global variable name patterns with 2 undrscores taking middle as a section name so you don't have to iterate over sections.
I am interested to know why Dock variables bumped up in your sections. If you catch it, let me know.
This isthe sample for you.
Again, keep in mind that MakeSection uses realy nasty hack to get list of globals you created which is proved to not work correctly with more then around 2000 variables. Lets hope Chris will fix this, or update ListVars.