Hi - my brain hurts from trying to figure this out so I've finally decided to ask for some guidance. I have a two dimensional array that I want to populate from records read from a flat text file. I've used the redim statement to size the array. As I read through my text file I increment an index variable for each record and want to use that as the "pointer" to the array entry. If I try to put data into each array entry using my variable, I get nothing. But if I enter a numeric literal instead of the variable, it works. An example of what I'm talking about:
dim MyArray(-1, -1) as text
dim some_text as text
redim MyArray(number_of_records_in_the_file, 7)
for i = 0 to number_of_records_in_the_file - 1
get some stuff here from the input file......
MyArray(i, 0) = some_text
What I get with that code is nulls in the array. If I change it for example to
MyArray(1, 0) = some_text
then I get whatever is in some_text placed into the array.
Am I doing something wrong, or is it not possible to use a variable to "loop" through an array?