News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Will the script can access the global variables for Code::Blocks?

Started by Chun Jiu, March 24, 2015, 05:52:39 PM

Previous topic - Next topic

Chun Jiu

Hi All,

I want to set and read the global variable in the startup script.

Is there any way you can do?
I love my girlfriend like c++!    :-)

[url="http://pan.baidu.com/s/1feNwU"]http://pan.baidu.com/s/1feNwU[/url]
easilygcc is a gmail's email.

oBFusCATed

Probably you can do it by directly altering the config file using the ConfigManager.

See here for details: http://wiki.codeblocks.org/index.php?title=Scripting_commands
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Chun Jiu

Quote from: oBFusCATed on March 24, 2015, 06:34:37 PM
Probably you can do it by directly altering the config file using the ConfigManager.

See here for details: http://wiki.codeblocks.org/index.php?title=Scripting_commands

ConfigManager only access new global variables for scripts in runtime. Do not know how to access global variables existing in CB.
I love my girlfriend like c++!    :-)

[url="http://pan.baidu.com/s/1feNwU"]http://pan.baidu.com/s/1feNwU[/url]
easilygcc is a gmail's email.

MortenMacFly

There is the global "ReplaceMacros" function exposed for that purpose.
If you call it with a macro it will provide you with the "translation".
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Chun Jiu

Quote from: MortenMacFly on March 25, 2015, 07:06:40 AM
There is the global "ReplaceMacros" function exposed for that purpose.
If you call it with a macro it will provide you with the "translation".

Thank all  :)

I'm looking for ways to add a global variables to cb. Because I want to use a script to replace the target compiler tool chain.
But found replacement target compiler ID can achieve the same purpose.
So, thanks guys  ;)
I love my girlfriend like c++!    :-)

[url="http://pan.baidu.com/s/1feNwU"]http://pan.baidu.com/s/1feNwU[/url]
easilygcc is a gmail's email.