COMSafeArray.Based on element type 2

Syntax:

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

Parameters:

<ElementType> (required)

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

<Count> (required)

Type: Array.
The number of COMSafeArray elements in each dimension. The size of the array is equal to the number of COMSafeArray dimensions.

<LowerBoundary> (optional)

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

Description:

Creates a COMSafeArray of a given size and element type without initializing the elements.
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.

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

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


    

1C:Enterprise Developer's Community