Syntax – array member reference
array_name [ { variable | numericExpression } [ ,...n ] ]
Parameters
array_name
The owning array to reference.
variable or numericExpression
The selector corresponding to the index of the array member to reference.
,...n
Any further selectors corresponding to indexes that identify the array member to reference.
Description
Array members can be referenced by specifying the index (or indexes) required to identify them within their owning array, using standard array index syntax. For example:
ArrayMember := MyArray[3]
The number of selectors specified determines a subset of the array which is selected. For example, in the following three-dimensional array (origin at the nearest topmost corner), MyArray:
If one selector is used, the result is a two-dimensional array of scalar variables corresponding to a vertical slice through the array parallel with the front face (MyArray[1]).
If two selectors are used, the result is a one-dimensional array of scalar variables corresponding to a horizontal segment of the array parallel to the front and top faces (MyArray[2, 1]).
If three selectors are used the result is a scalar variable (MyArray[4, 1, 5]).
Failure behavior
For primitive arrays, if a specified selector is not within the bounds of the array, the value of the array element is indeterminate, in that it can be different for Windows-based systems, MCP-based systems, OS2200-based systems and Debugger.
For object arrays, if a specified selector is not within the bounds of the array, the operand is ignored. For example, if we had logic:
Add 5 <object_array_out_of_bounds> Giving Result
The variable result would equal 5.
MCP-based systems
MCP-based systems use an array proxy to hold the value retrieved from the array that is updated. When a specified selector is not within the bounds of the array, the value of the array proxy is the value that was last retrieved from the array, or last updated.
If you want to initialize the array proxy when the specified selector is not within the bounds of the array, create a DWORD registry value named InitializeArrayProxy.
If you want to identify situations when a specified selector is not within the bounds of the array, create a DWORD registry value named ShowBadIndex.
The registry values should be located under this key:
For 32 bit: HKEY_LOCAL_MACHINE\SOFTWARE\Unisys\System Modeler\Features\Builder
For 64 bit: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Unisys\System Modeler\Features\Builder
You must restart the Visual Studio after creating the registry value and before building the system.