Arrays

Syntax – array member reference

array_name [ { variable | numericExpression } [ ,...n ] ]

Parameters

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:

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.