devxlogo

Prevent Confusion Between IsNULL and IsEmpty in VBScript

Prevent Confusion Between IsNULL and IsEmpty in VBScript

When you deal with unknown return values or variant variables whose types might be unknown, you may not know whether the value of the variable is an EMPTY string or a NULL value. In VBScript—where all variables are variants—variables can be one of two special values: EMPTY or NULL. EMPTY is defined as a variable with an un-initialized value, whereas NULL is a variable that contains no valid data.

NULL and EMPTY must be tested for in different manners. For example, with the following syntax, both must be tested before using the variable in question:

 If IsNull(variable)  Or  IsEmpty(variable) Then

See also  Professionalism Starts in Your Inbox: Keys to Presenting Your Best Self in Email
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist