Pages - Menu

Thursday, January 3, 2019

Types of variables in Vbscript


Types of variables in Vbscript

Variables are storage locations in memory where we can store the the values.

In vb script there are 3 types of variables.
  • Scalar  - contains only one value.
  • Array - contains many values.
  • Const - Constant variables
Scalar variable Example in vb script -
Dim a
a = 10

In above vb script example we have a variable called a with value as 10. We can store only one value in that variable at any point of time.

Array variable Example in vb script - 
Dim a (10)

 a(1) = 22
a(4) = 23

In above vb script example we have a variable called a with size of 10. We can store 11 value in that variable at any point of time.

Const variable Example in vb script - 
Const variable is a variable whose value does not change during the execution of the program.

const a=10


No comments:

Post a Comment