DIAdem Help

Method: IsEmpty for VBS

  • Updated2024-09-12
  • 1 minute(s) read

Method: IsEmpty for VBS

Specifies whether an expression contains a non-initialized variable.

vIsEmpty = Object.IsEmpty(expression)
ObjectVBS
Object with this method. You do not need to specify this object.
expressionVariant
Specifies any expression.
vIsEmptyVariant
The IsEmpty method returns True if the expression contains a non-initialized variable. Otherwise the method returns False.
In contrast to the value Empty, the value Null indicates that an expression contains invalid data.

The following example checks whether a variable was initialized:

Dim MyVar
Call MsgBox(IsEmpty(MyVar)) 'Returns True
MyVar = Null
Call MsgBox(IsEmpty(MyVar)) 'Returns False
MyVar = Empty
Call MsgBox(IsEmpty(MyVar)) 'Returns True
Set MyVar = Nothing
Call MsgBox(IsEmpty(MyVar)) 'Returns False

See Also

Objects Overview

Related Topics

IsArray | IsDate | IsEmpty | IsNull | IsNumeric | IsObject | TypeName | VarType

Log in to get a better experience