System.Internal.VarHlpr.VariantClear

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure VariantClear(var V: Variant);

C++

extern DELPHI_PACKAGE void __fastcall VariantClear(System::Variant &V);

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Internal.VarHlpr.pas
System.Internal.VarHlpr.hpp
System.Internal.VarHlpr System.Internal.VarHlpr

Description

Empties a Variant, so that it is unassigned.

Calling VariantClear is equivalent to assigning the Unassigned constant to the Variant. After calling VariantClear, the VarIsEmpty function returns true, and the VarType function returns varEmpty. Using an unassigned variant in an expression causes an exception to be thrown. Likewise, if you attempt to convert an unassigned Variant to another type (using VariantCast), an exception is thrown.

Note: Do not confuse clearing a Variant, which leaves it unassigned, with assigning a Null value. A Null Variant is still assigned, but has the value Null. Unlike unassigned Variants, Null Variants can be used in expressions and can be converted to other types of Variants.

See Also