Skip to content

TCustomVariantType.Cast

Cast a custom variant to another type.

Declaration

Source position: variants.pp line 207

public 
procedure TCustomVariantType.Cast(var Dest: tvardata; 
                                 const Source: tvardata);  virtual;

Description

Cast is called when a variant value Source is cast to a custom variant Dest. Descendents must override this method to provide the desired conversion behaviour.

The TCustomVariantType implementation of Cast calls CastTo on the source variant with as destination type the custom variant type.

Errors

If the variant type cannot be cast, an exception is raised.

See also

Name Description
TCustomVariantType.CastTo Cast a custom variant to another type.
TCustomVariantType.CastToOle Cast variant value to OLE value.