← Back to Advanced VBScript on ASPPY
Lesson 2

Dynamic Arrays and Dictionary

Advanced VBScript on ASPPY · Created 2026-06-01 13:34:28

Master arrays and the Dictionary object.

Fixed Array
Dim arr(5) : arr(0) = 'first'

Dynamic Array
Dim arr() : ReDim arr(0)
ReDim Preserve arr(1) : arr(1) = 'another'

Multi-dimensional
ReDim matrix(2, 2) : matrix(0,0) = 1

Array Functions
UBound(arr), LBound(arr), IsArray(arr)
Join(arr, ','), Split(str, ',')
Erase arr

Dictionary
Set dict = CreateObject('Scripting.Dictionary')
dict.Add 'key', 'value'
dict('key') = 'updated'
dict.Exists('key')
For Each k In dict.Keys()
For Each v In dict.Items()
dict.Count

Live Demo →