Difference between revisions of "getVariable"

From Bohemia Interactive Community
Jump to navigation Jump to search
(moved note)
(syntax with defaultValue)
Line 18: Line 18:
 
| [[Any Value]]<br> Returns [[Nothing]] if the variable doesn't exist.<br> Returns [[Anything]] if the object is undefined.<br> |= Return value
 
| [[Any Value]]<br> Returns [[Nothing]] if the variable doesn't exist.<br> Returns [[Anything]] if the object is undefined.<br> |= Return value
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
 +
|s2= object '''getVariable''' [name, defaultValue] |= Syntax
 +
 +
|p21= object: [[Object]] or [[Location]] |= Parameter 1
 +
 +
|p22= name: [[String]] - Variable name that was defined in [[setVariable]] ('''Case sensitive''') |= Parameter 2
 +
 +
|p23= defaultValue: [[Any Value]] - Value to return if variable doesn't exist |= Parameter 3
 +
 +
|r2= [[Any Value]]<br> Returns ''defaultValue'' if the variable doesn't exist.<br> Returns [[Anything]] if the object is undefined.<br> |= Return value 2
 +
____________________________________________________________________________________________
 +
 
|x1= <code>_aVariable <nowiki>=</nowiki> _myTruck getVariable "myVariable";</code> |= Example 1
 
|x1= <code>_aVariable <nowiki>=</nowiki> _myTruck getVariable "myVariable";</code> |= Example 1
 +
____________________________________________________________________________________________
  
 
| [[setVariable]], [[getVariable (VBS2)]] |= See also
 
| [[setVariable]], [[getVariable (VBS2)]] |= See also

Revision as of 12:24, 19 November 2010

Template:Command

Notes

Bottom Section