NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

10.5 Index expressions

An index expression results in the value of an array element or an indexed property. An index expression consists of an expression, followed by an open parenthesis, followed by an index argument list, followed by a close parenthesis. The expression must result in a value whose type is an array, in a value whose type has a set of overloaded default properties or in a set of overloaded properties.

If the expression results in overloaded properties or a value with default properties, the overload resolution rules are used to determine whether one of the properties is applicable to the index argument list. If no properties are applicable, then an error occurs. Otherwise, a function member invocation is performed on the getter with the index arguments and the result of the invocation becomes the value of the index expression. If the property is write-only, an error occurs.

If expression results in a value of an array type, the number of arguments in the argument list must be the same as the rank of the array type and may not include any named arguments. Each expression must be implicitly convertible to type Integer. The value of the index expression is the variable at the specified index.

At runtime, the argument list is evaluated first, and then the expression. If any of the indexes are invalid at runtime, a System.IndexOutOfRangeException exception is thrown.

IndexExpression ::= Expression ( ArgumentList )