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:

  • 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
  • Loops in Vbscript Loops in Vbscript Here is the list of different looping statements in vbscript. For ....Next For Each ...Next Do While...Loop Do Until....Loop While...Wend 'You can exit from For Loop with Exit For statement'For Loo… Read More
  • Sub Procedures in VBScript Sub Procedures in VBScript Sub procedures are used to perform the specific task. Sub procedures are used to increase the reusability of the code. Simple example of the procedure Suppose you want to find the sum of … Read More
  • What are different conditional statements in vbscript? What are different conditional statements in vbscript? In Vbscript there are 2 types of conditional statements. if ...else Select Case Example of if else -  a = 10 If a > 10 Then Msgbox "a is greater t… 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

0 comments:

Post a Comment

Blog Archive

Translate

Popular Posts

Total Pageviews

152,031

Blog Archive