I have what should be a very easy thing to do. I have searched the site using terms like "array of classes" and "class array" etc but find nothing.
Here is what I am trying to do. I have a class that basically has attributes (Team, Player#). Basically just lots of get/set methods. Lets call this class Point
Next I have another class that has a private instance of an array of 200 Point classes. Call this class Game.
In the Game class I have something like this
I of course initialize the Game object and then call the Reset method. I get a uninitialized object error when trying to set Team to 0.
What simple thing am I missing and how would I find an example of this using the web search function?
Thanks
Here is what I am trying to do. I have a class that basically has attributes (Team, Player#). Basically just lots of get/set methods. Lets call this class Point
Next I have another class that has a private instance of an array of 200 Point classes. Call this class Game.
In the Game class I have something like this
B4X:
sub Class_Globals
Private mPoints(200) as Point
end sub
public sub Reset()
For x = 0 To mPoints.Length-1
mPoints(x).Team= 0
mPoints(x).Player = 0
Next
I of course initialize the Game object and then call the Reset method. I get a uninitialized object error when trying to set Team to 0.
What simple thing am I missing and how would I find an example of this using the web search function?
Thanks