Author Topic: Will the script can access the global variables for Code::Blocks?  (Read 2902 times)

Offline Chun Jiu

  • Multiple posting newcomer
  • *
  • Posts: 71
  • My Girlfriend
    • EasilyGCC
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++!    :-)

http://pan.baidu.com/s/1feNwU
easilygcc is a gmail's email.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Will the script can access the global variables for Code::Blocks?
« Reply #1 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
(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!]

Offline Chun Jiu

  • Multiple posting newcomer
  • *
  • Posts: 71
  • My Girlfriend
    • EasilyGCC
Re: Will the script can access the global variables for Code::Blocks?
« Reply #2 on: March 25, 2015, 03:27:51 am »
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++!    :-)

http://pan.baidu.com/s/1feNwU
easilygcc is a gmail's email.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Will the script can access the global variables for Code::Blocks?
« Reply #3 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".
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Chun Jiu

  • Multiple posting newcomer
  • *
  • Posts: 71
  • My Girlfriend
    • EasilyGCC
Re: Will the script can access the global variables for Code::Blocks?
« Reply #4 on: March 25, 2015, 08:23:07 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++!    :-)

http://pan.baidu.com/s/1feNwU
easilygcc is a gmail's email.