I'm just trying to initialize an array in VBScript without specify its size and I'm getting the error: "Subscript out of range".
Option Explicit
dim arr()
arr(0)=2
Call MsgBox("arr: " & arr(0)) 'It prints 2
When I just edit the 2nd line to dim arr(1) it works.
I wonder it is a bug. Or I'm missing something?
I'm newbie with VBScript
ReDim Preserveto size the array without losing the contents