Open links in new tab
  1. VBScript - Arrays - Online Tutorials Library

    • Learn how to declare, assign, and manipulate arrays in VBScript, a scripting language for Windows. Find examples of single and multi-dimensional arrays, redim statement, and array methods.… See more

    What Is An array?

    We know very well that a variable is a container to store a value. Sometimes, developers are in a position to hold more than one value in a single variable at a time. When a series of values is stored in a single variable, then it is known as an array variable.

    TutorialsPoint
    Array Declaration

    Arrays are declared the same way a variable has been declared except that the declaration of an array variable uses parenthesis. In the following example, the size of the array is mentioned in the brackets. 1. Although, the Array size is indicated as 5, it can hold 6 values as array index starts from ZERO. 2. Array Index Cannot be Negative. 3. VBSc...

    TutorialsPoint
  1. In VBScript, an array is a variable that can hold multiple values at once. This is useful when you need to store a series of values in a single variable. Arrays in VBScript can store any type of variable, including integers, strings, and dates.

    Declaring Arrays

    Arrays are declared similarly to variables, but with parentheses to indicate the size. Here are three ways to declare an array:

    ' Method 1: Using Dim without size
    Dim arr1()

    ' Method 2: Mentioning the size
    Dim arr2(5) ' Declared with size of 5

    ' Method 3: Using Array function
    Dim arr3
    arr3 = Array("apple", "Orange", "Grapes")
    Copied!

    Assigning Values to an Array

    Values are assigned to an array by specifying the index. Here is an example:

    Dim arr(5)
    arr(0) = "1" ' Number as String
    arr(1) = "VBScript" ' String
    arr(2) = 100 ' Number
    arr(3) = 2.45 ' Decimal Number
    arr(4) = #10/07/2013# ' Date
    arr(5) = #12.45 PM# ' Time

    ' Displaying values
    document.write("Value stored in Array index 0: " & arr(0) & "<br />")
    document.write("Value stored in Array index 1: " & arr(1) & "<br />")
    document.write("Value stored in Array index 2: " & arr(2) & "<br />")
    document.write("Value stored in Array index 3: " & arr(3) & "<br />")
    document.write("Value stored in Array index 4: " & arr(4) & "<br />")
    document.write("Value stored in Array index 5: " & arr(5) & "<br />")
    Copied!
    Feedback
    • Docklight
      https://docklight.de
      About our ads

      VBScript Variables, Arrays - with VBScript

      SponsoredSend, receive and monitor data. RS232, RS485, TCP, UDP, HID & more.

      Edit Send Sequence · Advanced data detection · Reference Material

  2. VBScript Array Function - W3Schools

    Learn how to use the Array function to create and manipulate arrays in VBScript. See syntax, parameters, examples and output of the function.

  3. People also ask
  4. VBScript Arrays: Using DIM, REDIM, Split, and Ubound …

    Apr 1, 2025 · Learn how to declare, assign, and use arrays in VBScript, a scripting language for Windows. Find out the types, functions, and keywords of arrays, such as DIM, REDIM, Split, and Ubound.

  5. How does one declare an array in VBScript? - Stack Overflow

    VBScript's (variables and) arrays can't be typed, so no "as Whatever". VBscript's arrays are zero-based, so no " (x To y)" but only " (z)" where z is the last index (not the size) of the array.

    • Reviews: 1