System.VarClear
From RAD Studio VCL Reference
Contents |
Delphi Information
From System.pas
procedure VarClear(var V: Variant);
Unit: System
Type: procedure
Visibility: public
C++ Information
From System.hpp
void __fastcall VarClear(System::Variant & v);
Unit: System
Type: function
Description
Empties a Variant so that it is unassigned.
Calling VarClear is equivalent to assigning the Unassigned constant to the Variant. V can be either a Variant or an OleVariant, but it must be possible to assign a value to it (it must be an lvalue).
After calling VarClear, 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 VarAsType ), 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
Code Samples