Difference between revisions of "getVariable"

From Bohemia Interactive Community
Jump to navigation Jump to search
(see also)
(syntax format)
Line 32: Line 32:
 
| varspace '''getVariable''' name |= Syntax
 
| varspace '''getVariable''' name |= Syntax
  
|p1= varspace: [[Namespace]], [[Object]], [[Display]], [[Control]], [[Group]], [[Location]], [[Task]] or [[Team Member]] |= Parameter 1
+
|p1= varspace: [[Namespace]], [[Object]], [[Display]], [[Control]], [[Group]], [[Location]], [[Task]], [[Team Member]], [[Display]], [[Control]] |= Parameter 1
  
 
|p2= name: [[String]] - Variable name that was defined in [[setVariable]]  |= Parameter 2
 
|p2= name: [[String]] - Variable name that was defined in [[setVariable]]  |= Parameter 2
Line 41: Line 41:
 
|s2= varspace '''getVariable''' [name, defaultValue] |= Syntax
 
|s2= varspace '''getVariable''' [name, defaultValue] |= Syntax
  
|p21= varspace: [[Namespace]], [[Object]], [[Display]], [[Control]], [[Group]] or [[Team Member]] |= Parameter 1
+
|p21= varspace: [[Namespace]], [[Object]], [[Display]], [[Control]], [[Group]], [[Location]], [[Task]], [[Team Member]], [[Display]], [[Control]] |= Parameter 1
  
|p22= name: [[String]] - Variable name that was defined in [[setVariable]] |= Parameter 2
+
|p22= [name, defaultValue]: [[Array]]
  
|p23= defaultValue: [[Anything]] - Value to return if variable doesn't exist |= Parameter 3
+
|p23= name: [[String]] - Variable name that was defined in [[setVariable]] |= Parameter 2
 +
 
 +
|p24= defaultValue: [[Anything]] - Value to return if variable doesn't exist |= Parameter 3
  
 
|r2= [[Anything]] or ''defaultValue'' if the variable doesn't exist.<br>
 
|r2= [[Anything]] or ''defaultValue'' if the variable doesn't exist.<br>

Revision as of 10:56, 21 January 2017

Template:Command

Notes

Bottom Section

Posted on August 13, 2016 - 17:13 (UTC)
Ebay
NOTE: Arma 2 ONLY! In Arma 3 this will return default value. Warning: the alternative syntax returns undefined when the varspace is an object and that object is null. Example:
_test = objNull getVariable ["test","0"]; systemChat _test; Errors because _test is undefined. Tested in A2OA 1.63.131129