IsEmpty (function)

<< Click to Display Table of Contents >>

IsEmpty (function)

IsEmpty(Variant)

Checks whether the passed Variant variable has been initialized.

See also: IsDate, IsNull, IsNumeric, VarType, section Special behavior of the Variant data type

Example:

Sub Main

 Dim x       ' Empty because no value was assigned

 MsgBox "IsEmpty(x): " & IsEmpty(x)

 x = 5       ' Is not empty anymore

 MsgBox "IsEmpty(x): " & IsEmpty(x)

 x = Empty   ' Is empty again

 MsgBox "IsEmpty(x): " & IsEmpty(x)

End Sub