Pular para o conteúdo principal

VarArrayCreate

Creates a Variant array.

Structure

VarArrayCreate(const Bounds: array of Integer; VarType: Integer): Variant;

Parameters

Return Value

Description

VarArrayCreate creates a Variant array with the bounds given by Bounds and the element type given by VarType.

The Bounds parameter must contain an even number of values, where each pair of values specifies the upper and lower bounds of one dimension of the array.

The element type of the array, given by the VarType parameter, must be one of the TVarData type codes, and cannot include the varArray or varByRef bits. The element type cannot be varString. To create a Variant array of strings use the varOleStr type code. If the element type is varVariant, the elements of the array are themselves Variants and can in turn contain Variant arrays.

Note

Variant arrays with an element type of varByte are the preferred method of passing binary data between OLE Automation controllers and servers. Such arrays are subject to no translation of their data, and can be efficiently accessed using the VarArrayLock and VarArrayUnlock routines.

VarType has the following codes:

0: varEmpty: an unassigned variant

1: varNull: a null variant

2: varSmallint: a 16-bit signed integer

3: varInteger: a 32-bit signed integer

4: varSingle: a single-precision floating-point value

5: varDouble: a double-precision floating-point value

6: varCurrency: a currency floating-point value

7: varDate: a date/time value

8: varOLEStr: a reference to a unicode string

9: varDispatch: a reference to an Automation object

10: varError: an operating system error code

11: varBoolean: a boolean

12: varVariant: a 16 byte variant

12: varUnknown: a reference to an unknown COM object

17: varByte: an 8-bit unsigned integer

72: varStrArg

256: varString: a reference to an ANSI string

257: varAny: a pointer, used to pass to Corba functions

4095: varTypeMask: a bit mask for extracting type codes from variants

8192: varArray: bit indicating a variant array

16384: varByRef: bit indicating variant contains a reference, not a value |