VB keywords



VBScript Keywords

KeywordsDescription
Empty

is used to indicate an uninitialized variable value. When a variable is first created or when the variable value is explicitly set to null, the variable value is not initialized and the variable is not assigned a value.

Example:
Dim x 'Variable x is not initialized!
x="ff" 'Variable x is no longer uninitialized
x=Empty 'Variable x is not initialized!

Note: This is not the same as Null! !

IsEmpty

is used to test whether a variable is not initialized.

Example: If (IsEmpty(x)) 'Variable x is not initialized?

Nothing is used to indicate an uninitialized object value, or to separate object variables from the object to release system resources.

Example: Set myObject=Nothing

Is Nothing is used to test whether a value is an initialized object.

Example: If (myObject Is Nothing) 'Is it not set?

Note: If you compare a value to Nothing, you will not get the correct result! Example: If (myObject = Nothing) 'Always wrong!

Null is used to indicate that the variable does not contain valid data.

Null sets the value to "invalid", and Empty means the value is "not set".

Note: This is different from Empty or Nothing! !

Example: x=Null 'x does not contain valid data

IsNull is used to test whether a value contains invalid data.

Example: if (IsNull(x)) 'x is invalid?

True Used to indicate that a Boolean condition is correct (True is -1)
False Used to indicate that a Boolean condition is incorrect (False is 0)