Empty Example 2

Dim varTest
MsgBox CLng(varTest)
MsgBox CStr(varTest)

When you run this script, it will produce two dialogue boxes. The first box displays a 0 because Empty is 0 when represents as a number. The second box displays nothing because Empty is an "empty" or "zero length" string when represented as a String.

Once you place a value in a variant variable, it is no longer empty. It will take on another subtype, depending on what type of value you place in it. This is also true when you use a conversion function to coerce the subtype. However, if you need to, you can force the variable to become empty again by using the Empty keyword directly:

varTest = Empty