System.Variants.VarCheckEmpty

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure VarCheckEmpty(const V: Variant);

C++

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

Properties

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

Description

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

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.

See Also