System.Variants.TCustomVariantType.Create
Delphi
constructor Create; overload;
constructor Create(RequestedVarType: TVarType); overload;
C++
__fastcall TCustomVariantType()/* overload */;
__fastcall TCustomVariantType(System::Word RequestedVarType)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
constructor | public | System.Variants.pas System.Variants.hpp |
System.Variants | TCustomVariantType |
Description
Creates an instance of TCustomVariantType.
Call Create in the initialization section of the unit that defines your TCustomVariantType descendant to instantiate a single instance of the custom Variant type. This single instance automatically registers itself with the Variant system so that the custom Variant type is enabled in the application.
The RequestedVarType parameter specifies a type code for the new custom Variant type. It must be in the range from $010F to $0FFF.
When called with no parameters, the constructor generates a new type code for the custom Variant type.
The TCustomVariantType constructor raises an exception if there is a problem with the new Variant type code. Such problems include
The RequestedVarType parameter specifies a type code that is already used by another Variant type.
The RequestedVarType parameter specifies a type code that is not in the valid range for custom Variants.
There are too many custom Variants already defined to allow another one.