"Nicholas Paldino [.NET/C# MVP]" wrote:
rdh,
This should be relatively easy to reproduce. Can you post a compilable
example of where this happens?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"rdh" <rd*@discussions.microsoft.com> wrote in message
news:86**********************************@microsof t.com... I'm using List<> to store a class of positions.
Position are basically latitude and longitudes (doubles).
the line is something like
List<position> P = new List<position>();
Then I start adding to the List.
P.add(Positions);
After about 120 entry the List starts writing the enrty at 0 even thou the
list keeps growing. I watched it in the dbeugger overwrite all the values
in
the List as it adds the new one.
I made a temp that hold just a double and that works correctly.
Any body having trouble with List of classes?
Well, Not so easy... The lats and longs come from a file of about 5000 points.
but I did notice that some other class with a List<> is doing the same
thing, so I thinks it's me.
What I have is something like
class AC
{
private List<Position> m_pos;
}
class position
{
public double lat;
public double Long;
constructor is overloaded three times here.
}
Now, The class is used on a form as a private attribute of the form and init
isin the constructor. Since, both are doing the same thing I'm think Ive
placed them wrong.
soemthing like
class FORM1
{
private ac a;
public FORM1()
{
a = new ac();
}
public Click_Button()
{
// read the points from the file into a;
// it's here where the List<> starts to overwrite it self.
}
pubilc click_button2()
{
// do soemthing else with the ac
}
}
}
I'm working on a smaller example of the problem, it will take time,
Thanks for your help....
I guess my question is are the list going out-of scope?
Robert