getAttribute
Last updated
Last updated
Retrieves value from an attribute of an object variable in the application's local variable pool.
name
The variable's identifier containing the object.
Text
-
-
Yes
attribute
The attribute name of the object variable to retrieve value from.
Text
-
-
Yes
defaultValue
The default value to be used if the attribute does not exist or does not contain a value.
Any
-
-
No
The stored variable's value from the attribute, or null if the value does not exist, variable is not an object and default value is not supplied.
Any
In this example, we will use a value of an attribute from global variable which had been declared.
Drag a button
component into the canvas and open the Action
tab. Select the press
event of the button and drag the Log.write
function to the event flow.
Assuming you have followed the "Variable.setAttribute" fuction in help document, call the function.
If the specified global variable attribute has previously been set (see setAttribute
), the function will return the variable attribute's value ("Johnny" in this example).
If the specified global variable attribute does not exist, the function will return the value in defaultValue
.
See also
Functions