-
redim question
when i do a redim of an array, to raise the size, what happen with the data containing in the array, it loses?
i have an array based on the data from my DB, and i want to do a methode that verifys if there are new data, and if it have something, add to the array.
if some data is deleted i won´t lower the size, i just won´t use that object of the array anymore.
Thank you,
Guilherme Costa
-
Adds an extra space on the end of an array
Code:
Redim Preserve MyArray(ubound(MyArray)+1)
You can use dataset objects in .Net, but if you want a simple storage place then look into using a collection instead, its more flexible and quick to access if you use keys.
-
Hi,
The following statement resizes the array but saves the contents of the elements.
ReDim Preserve MyArray(15) ' Resize to 16 elements.
Full details in the microsoft vb.net help files under "Redim"