Array.value Method [AX 2012]
Gets or sets the value of the array element that is stored at the specified index.
- Type: int
The index number of the array element to get or set.
- Type: anytype
The value to assign to the array element at the specified offset; optional.
Return ValueType: anytype
The value that is stored at the specified offset.
The return type is the same as the type of the array.
If an attempt is made to read a value at an index that is beyond the last index that has a value, an exception is thrown.
If a value is written to a nonexistent location, all locations between the previous element and the nonexistent location are filled with default values, and the array is expanded.
The following example creates an array of integers and then uses the value method to add some values to the array. It then uses the value method to get the values that are stored in the array and test them.