Accessing system language array data

The Service Manager system language and JavaScript support the array-data type. However, the implementation of this data type is different. For that reason, the access to the elements inside the array is different as well.

While Service Manager allows array[<index>] access to system language arrays from JavaScript, it does not allow to access sub items in an array of array like this: array[<index1>][<index2>].

However, it is possible to access the sub items in an array of array using this syntax: array["<index1>.<index2>"] instead.

Example

// Create a nested system language array
var array1 = new SCDatum();
array1.setType(8);
array1.push("1_1");
array1.push("1_2");
array1.push("1_3");
 
var array2 = new SCDatum();
array2.setType(8);
array2.push("2_1");
array2.push("2_2");
array2.push("2_3");
 
var nestedArray = new SCDatum();
nestedArray.setType(8);
nestedArray.push(array1);
nestedArray.push(array2);
 
print("nestedArray: " + nestedArray);
print("Now printing the nested Arrays sub-arrays: ");
print("nestedArray[0]: " + nestedArray[0]);
print("nestedArray[1]: " + nestedArray[1]);
 
print("Now printing the elements of the first sub-array: ");
print('nestedArray["0.0"]: ' + nestedArray["0.0"]);
print('nestedArray["0.1"]: ' + nestedArray["0.1"]);
print('nestedArray["1.2"]: ' + nestedArray["1.2"]);