RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomVariantType.VarDataCastTo Method (TVarData, TVarData, TVarType)

Performs a cast from one Variant type to another.

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

Call VarDataCastTo from the implementation of a TCustomVariantType descendant to perform casts on the data from one Variant type to another. Do not use VarDataCastTo as the entire implementation of the CastTo method, as this will lead to a circular reference. 

Dest returns the result of the cast. If VarDataCastTo is called with no Source parameter, it also provides the source data to be cast. 

Source is the TVarData record to be cast. 

VarType is the type code of the Variant type to which the data should be cast. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!