System.VarUtils.VariantChangeType

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function VariantChangeType; external oleaut name 'VariantChangeType';

Properties

Type Visibility Source Unit Parent
function external public System.VarUtils.pas System.VarUtils System.VarUtils

Description

Converts a variant from one type to another.

Use VariantChangeType to convert the variant given in Source to the variant stored in Dest of type VarType, using the parameter wFlags, which specifies the conversion flags.

VariantChangeType returns the result of the conversion operation, which can be one of the following.



Value Meaning

VAR_OK

The conversion was successful.

VAR_BADVARTYPE

The variant type of the input parameter is not valid.

VAR_OVERFLOW

The data stored in the output parameter does not fit in the destination type.

VAR_TYPEMISMATCH

The argument cannot be cast to the specified type.

VAR_INVALIDARG

Either one of the arguments is invalid.

VAR_OUTOFMEMORY

There is not enough memory to complete the conversion.



Note: To do the conversion using locale-specific information, use the function referenced by the VariantChangeTypeEx variable.

See Also