Syntax
set anArray[ anIndex ] = <expression>
SemanticsThe operator [i] allows to set the i-th element of the array. The first element has the position 0. anIndex can be a static integer literal, an object type Integer or an E2E Action Language operation or expression returning an integer.
SubstitutablesanArrayCan be any variable or object attribute having the type Array.
anIndexCan be any expression that evaluates to an integer.

It is not possible to use class operations as index function – only built-in E2E Action Language operations are allowed.

Examples
set input.myList[index] = "changed";
set input.myComplexList[index].number = 8080;

Object input is of type Container (see class diagram in the next section) having a string array called myList and an array called myComplexList. The latter one holds elements of type Container, which in turn contain the integer attribute number.

Example File (Builder project E2E Action Language/Array):

<your example path>\E2E Action Language\Array\uml\arraySetElement.xml

The index number can be a static integer literal, an object of type Integer or an E2E Action Language operation or expression returning an integer. The following activity diagram illustrates some of the more complicated cases:

Figure: Setting Array Elements

Figure: Classes Used in the Setting Array Elements Example