RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomVariantType.CastTo Method

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

Pascal
procedure CastTo(var Dest: TVarData; const Source: TVarData; const AVarType: TVarType); virtual;
C++
virtual __fastcall CastTo(TVarData Dest, const TVarData Source, const TVarType AVarType);

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

Dest is a TVarData record that returns the System::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 System::Variant of this custom System::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 System::Variant data and casts it to the destination type. 

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

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!