by mmtbb » Sep 6, 2005 @ 4:32am
Dim(tt$,12);
showmessage(count(tt$)); shows 0
for(i$, 0, 11)
dd$ = "1,2,3";
strtolist(dd$, ",", tt$[i$]);
showmessage(tt$[i$][0]);
end;
One thing that I didn't show is farther down the code. This code is important because I need to create an array that holds the split string of numbers read from a file. This is used to define the object that is created later:
#object myclass theclass$(tt$[i$][0],tt$[i$][1],tt$[i$][2]);
remember, this all works perfectly (i.e. a class is created with all the proper construction) UNTIL I get past the size of the elements the are created from dd$. This seems screwy.
Let me even make it more clear. I have a class with 3 public variables: Name$, Size$, and Year$. I have 25 objects that need to be created. They are stored in a text file. like this:
Gordon, 123, 1996
Jim, 202, 1980
...and many more
At the beginning of my program, I open the file, do a loop and read each line to a variable, split the variable into three and use those three to feed to the constructor of the class.
Ok. Right now if I created People$[24] with 25 elements. Then used those people to each hold the 3 arguments to put through the constructor. So, this should allow my to make:
People$[0][0]
People$[0][1]
People$[0][2]
------------
People$[1][0]
People$[1][1]
People$[1][2]
------------
People$[24][0] //all the way to 24
People$[24][1]
People$[24][2]
My code should work. I already defined the first dim to make 25 people. I never mess with that again. My code is supposed to add the three args to the second dimension. However, it is giving me errors at people$[3][0] which it will not let me create. If I increaed the args to 4, Name Size, Year, Hair, then it would let me make one more set up to people[4][0]. I hope this makes sense. My code shouldn't effect the first dimension of people, but it is.