RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
Variants.VarCheckEmpty Function

Raises an exception if a specified variant's value is Unassigned.

Pascal
procedure VarCheckEmpty(const V: Variant);
C++
VarCheckEmpty(const Variant V);

Call VarCheckEmpty when your code requires that a System::Variant have a value, and you want to raise an exception if it doesn't. VarCheckEmpty checks whether the System::Variant specified by V has a value of Unassigned. If so, it raises an EVariantTypeMismatchError exception. 

To check whether the System::Variant is Unassigned without raising an exception, use the VarIsEmpty function instead. To check whether the System::Variant's value is undefined, use the VarIsClear function instead.

Note: Do not confuse an Unassigned variant with a System::Variant whose value is Null. 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.
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!