Thursday, January 3, 2019


Dynamic Arrays in VBScript example

In Vb script we can define the dynamic array in vb script as mentioned below.
Size of dynamic array changes at run time. 

Example -
Dim a () - declared dynamic array a

To use dynamic array, you must use redim statement.
ReDim a(22)
 . . . 
ReDim Preserve a(44)   ' Preserve statement preserves the elements in array
 


Related Posts:

  • 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
  • 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
  • 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
  • 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
  • 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

0 comments:

Post a Comment

Blog Archive

Translate

Popular Posts

Total Pageviews

150,588

Blog Archive