COMSafeArray.From array 2

Syntax:

New COMSafeArray(<Array>, <ElementType>, <Count>, <LowerBoundary>)

Parameters:

<Array> (required)

Type: Array.
An array is the data source for a COMSafeArray.

<ElementType> (required)

Type: String.
Defines the element type for a COMSafeArray.

<Count> (required)

Type: Array.
The number of COMSafeArray elements in each dimension. An array of whole numbers greater than 0. The size of the array is equal to the number of COMSafeArray dimensions.

<LowerBoundary> (optional)

Type: Array.
Minimum index values in each dimension. An array of whole numbers. The size of the array is equal to the number of COMSafeArray dimensions.

Description:

Creates a COMSafeArray containing a given type of element from those in the array.
The number of elements in each of the dimensions is given in one array. The lower index values for each dimension can be given in another array.

Example:

//Create a two-dimensional COMSafeArray with VT_I4 //element type, consisting of 2 rows and 3 columns.
//Receive elements values from the array.

Size = New Array;
Size.Add(2);
Size.Add(3);
Array = New COMSafeArray(Array, "VT_I4", Size);

// Same, but rows are numbered starting from -1, and //columns - from 2.
BottomBoundary = New Array;
BottomBoundary.Add(-1);
BottomBoundary.Add(2);
Array = New COMSafeArray(Array, "VT_I4", Size, BottomBoundary);


    

1C:Enterprise Developer's Community