Declaration¶
Source position: variants.pp line 168
type
TCustomVariantType = class(TObject, IInterface)
public
constructor Create; overload;
constructor Create(RequestedVarType: tvartype); overload;
destructor Destroy;
function IsClear : Boolean;
procedure Cast;
procedure CastTo;
procedure CastToOle;
procedure Clear;
procedure Copy;
procedure BinaryOp;
procedure UnaryOp;
function CompareOp : Boolean;
procedure Compare;
property VarType: tvartype; {r}
end;
Description¶
TCustomVariantType is used as a base class to implement custom variants. To define a custom variant type, a descendent of TCustomVariant must be made, and the appropriate methods must be overridden and implemented according to the specifications of the new type. Typically this means defining how your new type maps to another variant or a basic type.
Note that the TCustomVariantType descendent does not hold the data of the variant: it just describes how a variant record (TVarRec) that contains the new type's data can be examined or manipulated.
Properties¶
| Member | Visibility | Description |
|---|---|---|
| VarType read only | public | Registered type. |
Methods¶
| Member | Visibility | Description |
|---|---|---|
| BinaryOp | public | Perform a binary mathematical operation. |
| Cast | public | Cast a custom variant to another type. |
| CastTo | public | Cast a custom variant to another type. |
| CastToOle | public | Cast variant value to OLE value. |
| Clear | public | Clear a value. |
| Compare | public | Comparison 2 custom variant values. |
| CompareOp | public | Check result of a comparison between 2 custom variant values. |
| Copy | public | Copy a custom variant value. |
| Create | public | Instantiate a new custom variant type. |
| Destroy | public | Unregister variant type. |
| IsClear | public | Is the custom value unassigned ? |
| UnaryOp | public | Perform a unary mathematical operation. |
See also¶
| Name | Description |
|---|---|
| #rtl.system.TVarRec | Record describing an element in an array of const. |