get
Description
Returns the value of a global variable.
Input / Parameter
name
The name of the variable.
String/Text
-
-
Yes
defaultValue
The default value of the variable.
String/Text
-
-
No
Output
Returns the value of the global variable if there is a value, returns the defaultValue value otherwise.
String/Text
Example
In this example, we will get the value of a global variable and print it in the console.
Steps
Drag a
buttoncomponent into the canvas and open theActiontab. Select thepressevent of the button and drag theLog.writefunction to the event flow.Call the function
Variable.getinside theLog.writefunction. (*Note: TheLog.writefunction is used here for ease of demostrating the output.)Specify the variable name that you would like to access.

Result
If the specified global variable has previously been set (see
set), the function will return the variable's value ("1.0.0" in this example).
If the specified global variable does not exist, the function will return the value in
defaultValue.
Links
Related Information
See also:
Functions
Last updated