
Dynamic Data Structures: Dynamic Arrays?
Quote:
> VBScript fails as the definition expects an integer data constant...
> Dim iArrayIndex
> iArrayIndex = 1
> Dim aArray(iArrayIndex)
> aArray(0) = "Zero"
> aArray(1) = "One"
> Response.Write "aArray(0): " & aArray(0) & "<br />"
> Response.Write "aArray(1): " & aArray(1) & "<br />"
> I need to learn to create dynamic arrays. My example shows
> a single dimension but my application requires two dimensions
> where the second index must be created dynamically i.e. aArray(5,i).
> Can somebody explain how to do this with VBScript or
> provide a document resource where I can learn to create a
> dynamic array or a dynamic data structure that will allow me to
> achieve the same results as a two dimensional array?
ReDim Statement
http://msdn.microsoft.com/library/en-us/script56/html/vsstmredim.asp
Windows Script Documentation
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207...
Dim iArrayIndex
iArrayIndex = 1
Dim aArray()
ReDim aArray(iArrayIndex)
aArray(0) = "Zero"
aArray(1) = "One"
Response.Write "aArray(0): " & aArray(0) & "<br />"
Response.Write "aArray(1): " & aArray(1) & "<br />"
--
Steve
The whole problem with the world is that fools and fanatics are always so
certain of themselves, and wiser people so full of doubts. -Bertrand Russell