Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

VBScript Keywords

VBScript Keywords


VBScript Keywords

The keyword Description
Empty

Used to indicate an uninitialized variable value. A variable value is uninitialized and unassigned when the variable is first created or when its value is explicitly set to empty.

Example:


Dim x 'variable x is uninitialized!
x="ff" 'variable x is no longer uninitialized
x=Empty 'variable x is uninitialized!

Note:This is different from Null!!

| | IsEmpty |

Used to test whether a variable is uninitialized.

Example: If (IsEmpty(x)) 'is variable x uninitialized?

| | Nothing | Used to indicate an uninitialized object value, or to detach an object variable from an object to release system resources.

Example: Set myObject=Nothing

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

Example: If (myObject Is Nothing) 'is it unset?

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

| | Null | Used to indicate that a variable contains no valid data.

Null sets a value to "invalid", while Empty indicates a value is "unset".

Note:This is different from Empty or Nothing!!

Example: x=Null 'x contains no valid data

| | IsNull | Used to test whether a value contains invalid data.

Example: if (IsNull(x)) 'is x 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) |