Element Access

An element access expression is declared as follows.

element-access:

primary-no-array-creation-expression   [   expression-list   ]

expression-list:

expression

expression-list   ,   expression

If the primary expression of an element access is a value of an array type, the element access is an array access. Otherwise, the primary-no-array-creation-expression must be an access to a property that has some parameters, in which case the element-access is an indexer access.

Array Access

For an array access, the primary expression must be a value of an array type. The number of expressions in the expression list must be the same as the rank of the array type, and each expression must be of the Integer, UInteger, Long, or ULong type, or of a type that can be implicitly converted to one of these types.

The result of calculating the expression is a variable of the element type of the array, namely the array element with indexes declared by the values of the expressions in the expression list.

See also:

Primary Expressions