V
vbDavidC
Hi,
I am wondering what the best way to define an array is if you don't
know how many elements should be in the array:
I created the following array, I initially set it to 10 but got an
error when I went over so I defined it to 50 cause I am certain 50
will not be reached.
dim lastname(50) as string
I am populating this array from my database with a data reader. After
I put the results into an array I REDIM PRESERVE with the correct
number, but I am wondering if there is a smarter way of doing it.
I also ask if creating the array like this can be wasteful. For
example if I were to create an int32 array does each element get
stored with x bytes, even if the element is empty?
I am wondering what the best way to define an array is if you don't
know how many elements should be in the array:
I created the following array, I initially set it to 10 but got an
error when I went over so I defined it to 50 cause I am certain 50
will not be reached.
dim lastname(50) as string
I am populating this array from my database with a data reader. After
I put the results into an array I REDIM PRESERVE with the correct
number, but I am wondering if there is a smarter way of doing it.
I also ask if creating the array like this can be wasteful. For
example if I were to create an int32 array does each element get
stored with x bytes, even if the element is empty?