D
D
Diamond2017-02-08 15:41:16
VBScript
Diamond, 2017-02-08 15:41:16

How to redefine an array within an array?

There is an array with arrays (not a two-dimensional array), you need to redefine the array within the array.
Example:

Dim arrData(5)
arrData(0) = Array(...)
arrData(1) = Array(...)
...
ReDim Preserve  arrData(1)(новый размер) 'Так сделать не получиться

Didn't find a solution. There is an option to rebuild the array, but with the desired values.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
omegastripes, 2017-02-17
@omegastripes

In this case, the only way out is to copy the nested array into a variable, modify and overwrite the old one.

Dim arrData(5)
arrData(0) = Array(1, 10, 100)
arrData(1) = Array(2, 20, 200)

arrTmp = arrData(1)
ReDim Preserve arrTmp(9)
arrData(1) = arrTmp

MsgBox UBound(arrData(1)) ' 9

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question