Thursday, January 3, 2019


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


Related Posts:

  • Classes in VBScript Classes in VBScript Here is an example that shows how we can create a class in QTP. Once we define the class, we can create its objects and then access its method and properties. 'declare the class book. Class Bo… Read More
  • How we can define array in vb script How we can define array in vb script Arrays are used to store multiple values in the same variable.We can define array in vb script in 4 different ways. dim a(10)  - static array of 11 elements dim b()  … Read More
  • Date time functions in vb script Date time functions in vb script It is very important that you know how to work with date and time in VBScript as most of the VBScript programs will have date and time involved in it.Below is the list of all date and … Read More
  • Types of Array in vb script Types of Array in vb script There are 2 types of arrays in vb script. Static(Fixed Size) Dynamic Static ArraysStatic array can contain fixed number of elements in array.Example -dim a (10) - This static array will … Read More
  • Error handling in VBScript Error handling in VBScript VBScript provides below statements and keywords to handle errors. on error resume next Err object - err.description, err.number Sample code to handle the error is given below If er… Read More

0 comments:

Post a Comment

Blog Archive

Translate

Popular Posts

Total Pageviews

151,971

Blog Archive