Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

asp
vb

What are ASP VB keywords?

Khizar Hayat Saani

ASP (Active Server Pages) is a tool used for making dynamic web pages.

The scripting language used in ASP is VBScript.

There are eight keywords that ASP VB works on. These keywords form the framework of the system and allow the user to make use of the powerful services it offers.

ASP VB Keywords

1. Empty

The Empty keyword is used to either check or indicate (as per requirement) an uninitialized variable value.

If a variable is declared but not initialized, it has the value Empty assigned to it by default. The programmer may also choose to assign Empty to a variable.

Dim my_variable
'The value assigned to my_variable is Empty by default

my_variable = 12
'my_variable now has the value 12 stored in it

my_variable = Empty
'Empty has now been re-assigned to my_variable

2. IsEmpty()

IsEmpty() is a function in ASP VB used to test whether a variable has been initialized or not.

'Let us declare a variable
Dim my_variable

If (IsEmpty(my_variable))
'IsEmpty() will return true if the variable is uninitialized and false otherwise

3. Nothing

Nothing is associated with an object variable that has not been initialized.

It is also used to disassociate the instance of an object from the object variable, with the goal of releasing system resources.

'Let us declare an object variable
Dim my_obj

Set my_obj = Nothing
'This sets my_obj to Nothing. No instance has been declared yet, hence, bare minimum system resources have been utilized

4. IsNothing()

IsNothing() is a function used to test if an object variable has been initialized with an instance or not.

'Let us declare an object variable
Dim my_obj

If (IsNothing(my_obj))
'IsNothing() will return true if the object variable has not been assigned an instance and vice versa

5. Null

The Null keyword is used to exhibit that no valid data has been assigned to this variable. It is important to understand that Empty and Null are not the same thing.

While Empty means no data (i.e., an empty set) has been assigned to the variable, Null symbolizes that no valid data (i.e., incompatible set) has been assigned.

'Let us declare a variable
Dim my_var

my_var = Null
'This sets my_var to Null. No valid data has been associated.

6. IsNull()

IsNull() is a function used to test whether invalid data is stored in a variable.

Dim my_var
my_var = Null

If (IsNull(my_var))
'IsNull() will return true if the variable has not been assigned any valid data and vice versa

7. True

Like any other language, True is a boolean indicator of a condition that is correct.

8. False

Contrary to True, False is a boolean indicator used to mark a condition that is untrue.

RELATED TAGS

asp
vb

CONTRIBUTOR

Khizar Hayat Saani
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring