Code::Blocks Forums

User forums => Help => Topic started by: eyeofhell on May 02, 2008, 05:13:06 pm

Title: newb question about scripting and GetConfigManager()
Post by: eyeofhell on May 02, 2008, 05:13:06 pm
Hello. I'm new to cb and interested to change a few settings from a script.

AFAIK, GetConfigManager().Read() and GetConfigManager().Write() allows to change cb settings loaded from default.conf XML.

Unfortunately, i can't find enough documentation in help, sources and this forum search :(

I have tried the code from one of the wizards, changing my startup.script to the following:

local n = GetConfigManager().Read(_T("/wx_project_wizard/dll"), 47);
local s = _T( "val: " ) + n;
Log( s );

that work fine, displaying value of '1' (not a default 47 i have specified).

But i can't find a way to read values outside of 'wx_project_wizard' XML branch :(. If i change code to the following:

local n = GetConfigManager().Read(_T("/astyle/STYLE"), 47);
local s = _T( "val: " ) + n;
Log( s );

it will display 47, that means that value is not read :(.

How i can write a script that will read and write any value from cb settings? For example, i'm interested in /CodeBlocksConfig/editor/colour_sets/default/cc/editor/keywords/SET1
Title: Re: newb question about scripting and GetConfigManager()
Post by: Biplab on May 02, 2008, 07:09:09 pm
Actually GetConfigManager() returns all the settings under scripts section. That's the reason it returns garbage for other settings. :)
Title: Re: newb question about scripting and GetConfigManager()
Post by: mandrav on May 02, 2008, 10:32:19 pm
Actually GetConfigManager() returns all the settings under scripts section. That's the reason it returns garbage for other settings. :)

And is actually a conscious design decision which is not going to change.
Title: Re: newb question about scripting and GetConfigManager()
Post by: eyeofhell on May 03, 2008, 12:56:40 am
And is it any way to change other settings from script ?
Title: Re: newb question about scripting and GetConfigManager()
Post by: LETARTARE on February 02, 2012, 12:20:31 pm
With the help of a script  plugin , I try to retrieve the installation path of an executable installed in "Tool".
But 'GetManager (). Read ()' seems to give only the default.

Mandrav indicates that it will not change.

And just to read. NO?