Difference between revisions of "Environment Variables plugin"

From Code::Blocks
m (System! (not global) variables...)
(Add scripting documentation)
 
Line 12: Line 12:
 
The dialog for editing the sets is located in Settings->Environment->Environment variables.<br/>
 
The dialog for editing the sets is located in Settings->Environment->Environment variables.<br/>
 
The dialog for choosing the active set for the current project is located in Project->Properties->EnvVar options.
 
The dialog for choosing the active set for the current project is located in Project->Properties->EnvVar options.
 +
 +
==Script binding==
 +
This plugin provides its functionality through a squirrel binding:
 +
{| border="1" cellpadding="3" cellspacing="0" style="border: 1px solid gray; border-collapse: collapse;"
 +
|- style="background: #ececec; border: 0px solid gray"
 +
!Return value
 +
!Name
 +
!Arguments
 +
!Remarks
 +
|-
 +
 +
|-
 +
| wxArrayString|| EnvvarGetEnvvarSetNames|| || Returns all envvars sets available
 +
|-
 +
 +
|-
 +
| wxString|| EnvvarGetActiveSetName||  ||  Returns the name of the currently active set (from config, /active_set)
 +
|-
 +
 +
|-
 +
| wxArrayString|| EnvVarGetEnvvarsBySetPath|| const wxString set_name ||  Returns the envvars of an envvars set path in the config
 +
|-
 +
 +
|-
 +
| bool|| EnvvarSetExists|| const wxString set_name || Verifies if an envvars set really exists in the config
 +
|-
 +
 +
|-
 +
| bool|| EnvvarSetApply|| const wxString& set_name, bool even_if_active || Applies a specific envvar set from the config (without UI interaction)
 +
|-
 +
 +
|-
 +
| void || EnvvarSetDiscard|| const wxString || Discards a specific envvar set from the config (without UI interaction)
 +
|-
 +
 +
|-
 +
| bool|| EnvvarApply|| const wxString key, const wxString value||  Applies a specific envvar
 +
|-
 +
 +
|-
 +
| bool|| EnvvarDiscard|| const wxString key|| Discards an envvar
 +
|-
 +
 +
|}
 +
 +
'''NOTE:''' The value arguments are automatically expanded from macros. You do not have to call <code>ReplaceMacros()</code> on them
 +
 +
=== Example ===
 +
On windows in the post or pre build steps:
 +
 +
<source lang="c">
 +
[[EnvvarApply(_("test"),_("testValue"));]]
 +
echo %test%
 +
</source>
  
 
==See also==
 
==See also==
 
* [[Code::Blocks variable types synthesis]]
 
* [[Code::Blocks variable types synthesis]]

Latest revision as of 20:06, 16 September 2019

Environment Variables Editor
Envvars.png
Developer(s): MortenMacFly
Maintainer(s): MortenMacFly
Version: 0.97

Environment variables editor plugin allows for the setting of system environment variables in the focus of Code::Blocks. A user can have several sets that contain 1..n environment variables. A user can switch between these sets within the environment variables configuration dialog. In addition the EnvVars plugin offers an option to projects (within project setup) to apply a certain EnvVar set to activate (and use during compilation).

The dialog for editing the sets is located in Settings->Environment->Environment variables.
The dialog for choosing the active set for the current project is located in Project->Properties->EnvVar options.

Script binding

This plugin provides its functionality through a squirrel binding:

Return value Name Arguments Remarks
wxArrayString EnvvarGetEnvvarSetNames Returns all envvars sets available
wxString EnvvarGetActiveSetName Returns the name of the currently active set (from config, /active_set)
wxArrayString EnvVarGetEnvvarsBySetPath const wxString set_name Returns the envvars of an envvars set path in the config
bool EnvvarSetExists const wxString set_name Verifies if an envvars set really exists in the config
bool EnvvarSetApply const wxString& set_name, bool even_if_active Applies a specific envvar set from the config (without UI interaction)
void EnvvarSetDiscard const wxString Discards a specific envvar set from the config (without UI interaction)
bool EnvvarApply const wxString key, const wxString value Applies a specific envvar
bool EnvvarDiscard const wxString key Discards an envvar

NOTE: The value arguments are automatically expanded from macros. You do not have to call ReplaceMacros() on them

Example

On windows in the post or pre build steps:

[[EnvvarApply(_("test"),_("testValue"));]]
echo %test%

See also