System.Variant.Create

From RAD Studio API Documentation
Jump to: navigation, search

C++

Variant();
Variant(const Variant& src);
Variant(const TVarData& src);
Variant(const bool src);
Variant(const char src);
Variant(const signed char src);
Variant(const unsigned char src);
Variant(const short src);
Variant(const unsigned short src);
Variant(const int src);
Variant(const unsigned int src);
Variant(const long src);
Variant(const unsigned long src);
Variant(const float src);
Variant(const double src);
Variant(const long double src);
Variant(const __int64 src);
Variant(const unsigned __int64 src);
Variant(const CURRENCY& src);
Variant(const DECIMAL& src);
Variant(const SAFEARRAY& src);
Variant(const VARIANT& src);
Variant(SAFEARRAY* src);
Variant(VARIANT*   src);
Variant(const TVariant& src);
Variant(const AnsiString& src);
Variant(const Currency& src);
Variant(const TDateTime& src);
Variant(const VariantError& src);
Variant(const WideString& src);
Variant(const UnicodeString& src);
Variant(const char* src);            // Treated as pointer Asciiz string
Variant(wchar_t* src, bool makeCopy = false);
Variant(IUnknown* src);
Variant(IDispatch* src);
Variant(const System::DelphiInterface<IDispatch>& src);
Variant(signed char* src);
Variant(unsigned char* src);
Variant(short* src);
Variant(unsigned short* src);
Variant(int* src);
Variant(unsigned int* src);
Variant(long* src);
Variant(unsigned long* src);
Variant(float* src);
Variant(double* src);
Variant(__int64* src);
Variant(unsigned __int64* src);
Variant(CURRENCY* src);
Variant(DECIMAL* src);
Variant(SAFEARRAY** src);
Variant(wchar_t** src);              // VT_BSTR|VT_BYREF
Variant(Currency* src);
Variant(TDateTime* src);
Variant(Variant* src);
Variant(const int* bounds, const int boundsSize, Word varType);
Variant(const Variant* values, const int valuesSize);

Properties

Type Visibility Source Unit Parent
constructor public sysvari.h System Variant

Description

Creates an instance of System.Variant.

The first System.Variant.Variant constructor above creates a variant instance with the value Unassigned.

The second System.Variant.Variant constructor creates a System.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, and each pair of values must specify the upper and lower bounds of one dimension of the array.

The boundsSize parameter is the index of the last element in bounds.

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 an array of strings, use the varOleStr type code. If the element type is varSystem.Variant, the elements of the array are themselves Variants and can, in turn, contain System.Variant arrays.

The third System.Variant.Variant constructor creates a one-dimensional System.Variant array with the elements given by the values parameter. The low bound of the returned array is zero, the high bound is given by valuesSize (the index of the last value). The element type of the instantiated array is System.Variant.

The remaining System.Variant.Variant constructors create a System.Variant with the same value as the src argument, converting src as appropriate. Constructors that declare src as a const parameter copy src into the variant's internal representation. Constructors that do not declare src as a const create a reference to src and set the variant's varByRef bit.

See Also