Hi,
I've written a simple loop in a method and I'm totally lost here. The first
Console.WriteLine is passed only once as where the second one is passed
twice for the same value of 'i'.
public void CalculateOld ()
{
Console.WriteLine("Calculate");
m_TotalPremium = 0f;
for (int i = 0; i < Coverage.Count; i++)
{
Premium[i] = i * 10.00f;
Console.WriteLine(i);
if(Coverage[i])
{
m_TotalPremium = m_TotalPremium +
Premium[i];
}
}
}
Results in:
Calculate
0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
Has anyone ever seen this before?
Regards
Paul Sinnema
--
View this message in context:
http://monotouch.2284126.n4.nabble.com/Loop-runs-twice-tp4431082p4431082.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch