COMSafeArray.Based on element type 1

Syntax:

New COMSafeArray(<ElementType>, <,...,>)

Parameters:

<ElementType> (required)

Type: String.
Defines the element type for a COMSafeArray.
The element type is given by string and can take one of the following values:
  • VT_I1 - signed integer 1 byte;
  • VT_I2 - signed integer 2 bytes;
  • VT_I4 - signed integer 4 bytes;
  • VT_I8 - signed integer 8 bytes;
  • VT_INT - signed integer;
  • VT_UI1 - unsigned integer 1 byte;
  • VT_UI2 - unsigned integer 2 bytes;
  • VT_UI4 - unsigned integer 4 bytes;
  • VT_UI8 - unsigned integer 8 bytes;
  • VT_UINT - unsigned integer;
  • VT_R4 - real number 4 bytes;
  • VT_R8 - real number 8 bytes;
  • VT_DECIMAL - decimal number with fixed period 12 byte;
  • VT_CY - value of currency type;
  • VT_DATE - value of date type;
  • VT_BSTR - value of string type;
  • VT_DISPATCH - indicator for IDispatch interface;
  • VT_ERROR - error code;
  • VT_BOOL - value of logical type;
  • VT_UNKNOWN - indicator for IUnknown interface;
  • VT_VARIANT - variant type.

<,...,> (required)

Type: Number.
The number of elements in COMSafeArray each dimension, beginning with the first.
  • <size0> gives the number of elements in the null, first, dimension COMSafeArray
  • <size1> gives the number of elements in the first dimension, if the COMSafeArrayis more than two-dimensional;
etc. The total number of parameters must the same as the number of dimensions in the COMSafeArray.

Description:

Creates a COMSafeArray of a given size and element type without initializing the elements.

Example:

//Create a two-dimensional COMSafeArray with VT_I4 //element type, consisting of 2 rows and 3 columns.
Array = New COMSafeArray("VT_I4", 2, 3);


    

1C:Enterprise Developer's Community