Namespace: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) (Add currentNamespace) |
(→Set namespace data: Tweak description) |
||
Line 31: | Line 31: | ||
== Set namespace data == | == Set namespace data == | ||
To set data to a namespace, there're two methods to do: | |||
<code>'''namespace''' [[setVariable]] ["variableName",any];</code> | |||
<code>[[with]] '''namespace''' do { | |||
variableName = any; | |||
};</code> | |||
[[missionNamespace]] is the default global namespace, so just "variableName = any;" will store data to [[missionNamespace]]. | |||
[[Category: Data Types]] | [[Category: Data Types]] |
Revision as of 09:43, 3 January 2020
Namespace - set of variables. Introduced with Arma 2.
Get namespace
These commands return the "Namespace" type:
Game | Command | Description |
---|---|---|
1.00 | missionNamespace | returns the global namespace attached to the mission |
1.00 | parsingNamespace | returns the global namespace attached to the Config Parser |
1.00 | uiNamespace | returns the global namespace attached to the user interface |
1.00 | profileNamespace | returns the global namespace attached to the user profile |
1.48 | currentNamespace | returns the current namespace. Can be compared with isEqualTo. |
You can save values in this different Namespaces without overwriting the variables with the same name.
Get namespace data
You can use the above with getVariable to get data.
Set namespace data
To set data to a namespace, there're two methods to do:
namespace setVariable ["variableName",any];
with namespace do {
variableName = any;
};
missionNamespace is the default global namespace, so just "variableName = any;" will store data to missionNamespace.