Unit 'Variants' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#rtl]

VarAsType

Attempt to cast a variant to another type.

Declaration

Source position: variants.pp line 76

function VarAsType(

  const V: Variant;

  aVarType: TVarType

):Variant;

Description

VarAsType attempts to cast the variant V to a new variant of type aVarType and returns the new variant.

Errors

If the requested type cast is not supported or possible, an EVariantTypeCastError exception may be raised.

See also

EVariantTypeCastError

  

Error raised when an invalid typecast is performed.

VarIsType

  

Check if a variant is of certain type.

VarAsType

  

Attempt to cast a variant to another type.


Documentation generated on: Nov 22 2024