System.Variant.Create

From RAD Studio API Documentation
Jump to: navigation, search

C++

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