System.Variants.TCustomVariantType.CastTo

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure CastTo(var Dest: TVarData; const Source: TVarData;
const AVarType: TVarType); virtual;

C++

virtual void __fastcall CastTo(TVarData &Dest, const TVarData &Source, const System::TVarType AVarType);

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Variants.pas
System.Variants.hpp
System.Variants TCustomVariantType

Description

Converts data in the format of this TCustomVariantType to the format of another Variant type.

Override CastTo to enable Variants of this custom type to be cast to other Variant types.

Dest is a TVarData record that returns the Variant's data stored in the format identified by the AVarType parameter. The CastTo method fills out this record.

Source is the data from a Variant of this custom Variant type. CastTo extracts the data from this record, converts it to the format expected by AVarType, and fills out Dest. If the VType field of source is not the same as the VarType property, then CastTo creates a new instance of the associated Variant data and casts it to the destination type.

AVarType is the type to which the data should be converted.

See Also