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);

Variants

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

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

Note: Do not confuse an Unassigned variant with a 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.
 

 

VarIsEmpty 

Unassigned 

VarType 

VarIsNull 

VarIsClear 

EVariantTypeMismatchError

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!