getValue
Returns the value of a scalar data object or item within an array data object.
| Syntax | |||||||||||||||||||||
| value = AM_data.getValue(id, row_index, col_index) | |||||||||||||||||||||
| Parameters | |||||||||||||||||||||
| id | (required). Identifier of the data object. | ||||||||||||||||||||
| row_index | (optional). Zero based row index of the array data object item. (default "0") | ||||||||||||||||||||
| col_index | (optional). Zero based column index of the array data object item. (default "0") | ||||||||||||||||||||
| Return Value | |||||||||||||||||||||
| value | Value of scalar data object or array data object item. | ||||||||||||||||||||
| Example | |||||||||||||||||||||
| This example demonstrates accessing a scalar data object directly as property of the data scripting object AM_data. The example first sets the value of the scalar data object "did_sometext" to "The quick brown fox". The value of the scalar object "did_sometext" is then presented in an alert message dialog box. Note the use of "alert" assumes this script is part of a HTML resource. | |||||||||||||||||||||
| AM_data.did_sometext = "The quick brown fox"; alert(AM_data.sometext); | |||||||||||||||||||||
| Example | |||||||||||||||||||||
| This example demonstrates working with array data Objects using the data scripting object. | |||||||||||||||||||||
Assume we have declared an array data Meta Object with a unique identifier of "did_myarray" having the following values. Note the row and column indexes are bolded.
var number = AM_data.getValue("did_myarray" "1","2"); // number now equals 700. i.e. we retrieved the value within our array at row index 1 and column index 2. Note these indexes are zero based. | |||||||||||||||||||||