COMSafeArray.SetValue

Syntax variant: List of indices

Syntax:

SetValue(<Index0>, <Index1>, <ElementValue>)

Parameters:

<Index0> (required)

Type: Number.
The value of the first index.

<Index1> (optional)

Type: Number.
The value of the next index, if the array is more than one-dimensional.

<ElementValue> (required)

Item value being set. The type of this parameter must not conflict with the established array element type COMSafeArray.

Description of method variant:

The values of array element indices, beginning with the first and the specified value. Every parameter except the last defines the value of one index. There are as many parameters as there are dimensions in the array. The type of all parameters is Number. The last parameter is the specified array element value.

Syntax variant: Array of indices

Syntax:

SetValue(<Indices>, <ElementValue>)

Parameters:

<Indices> (required)

Type: Array.
Array of indices, beginning with the first. There are as many indices as there are dimensions in the array COMSafeArray. The type for all parameter array elements is Number.

<ElementValue> (required)

Type: Arbitrary.
Item value being set. The type of this parameter must not conflict with the established array element type COMSafeArray.

Description of method variant:

All indices are enumerated in one array, beginning with the first index.

Description:

Specifies the array element value corresponding to the indicated indices.

Availability:

Server, thick client, external connection.

Note:

If any of indices exceeds the permitted range, no actions will be performed and the message "Index value exceeds range limits" will be displayed.
If the value cannot be converted to the element type COMSafeArray, a message will be displayed indicating that type conversion is not allowed.

Example:

Array.SetValue(1, 2, 2, ArrayElement);
Indexes = New Array;
Indexes.Add(1);
Indexes.Add(2);
Indexes.Add(2);
Array.SetValue(Indexes, ArrayElement);


    

1C:Enterprise Developer's Community