Hello,
I am trying to create a multidimensional dynamic array, but it does not seem possible. In short, I am using the split() function to pull data into a dynamic array, because I do not know ahead of time how many times I will have to call the split() function. Because the data being split is separated by multiple spaces (not tabs or commas), I end up w/ many empty elements. Here is the process:
I could make arrData fixed
but the rows will change and I can't redim a fixed array.
Is there some way to declare an array as dynamic and have it multidimensional, or is there some way to easily delete the empty rows at the end of arrData (if I declare 10 rows in arrData, but only encounter 6, then there are 4 empty element rows at the end of the array.
Thanks in advance.
Ken
I am trying to create a multidimensional dynamic array, but it does not seem possible. In short, I am using the split() function to pull data into a dynamic array, because I do not know ahead of time how many times I will have to call the split() function. Because the data being split is separated by multiple spaces (not tabs or commas), I end up w/ many empty elements. Here is the process:
Code:
dim arrSplit() as string
dim arrData() as string
- arrSplit = split(string)
- Loop through the elements looking for the non-empty elements and place those into another array. When not empty, assign value to variable
- At end of the loop its time to populate arrData(), but I can't redim because arrData is multi-dimensional (i,j).
I could make arrData fixed
Code:
dim arrData(10,6) as string
Is there some way to declare an array as dynamic and have it multidimensional, or is there some way to easily delete the empty rows at the end of arrData (if I declare 10 rows in arrData, but only encounter 6, then there are 4 empty element rows at the end of the array.
Thanks in advance.
Ken