sb.getData

sb.getData(key[, key2, ...])

Gets one or more values from the data manager. Each argument to the function is interpreted as a data manager key whose value should be extracted from the data manager. This function returns an object using all the values as indexes and the corresponding value is the data returned from the data manager. A null value is returned for any values that do not match a key in the data manager.

Parameters:
    key The key whose value should be extracted from the data manager

Returns
    A JS object containing the passed in arguments as keys and the resulting data manager values as the values associated with those keys.

Example:

//Accessing Control Variables
function get_data_func(context) {    
    //When accessing control variables, use the following qualified    
    //model path Layer.Control.Variable    
    var data_table = sb.getData("my_layer.my_control.variable_name");    
    var value = data_table[my_layer.my_control.variable_name];    
    print("control_variable_name = " .. value.tostring());
}    

//Accessing Control Width (Internal Variable)
function get_control_width(context) {    
    //This will extract the width (grd_width) of the control    
    //'my_control' on the layer 'my_layer'    
    var data = sb.getData("my_layer.my_control.grd_width");   
    var value = data[my_layer.my_control.grd_width];    
    print("The width of the control is " + value.tostring());
}
Was this article helpful?
0 out of 0 found this helpful