All pastes #2099702 Raw Edit

Mine

public text v1 · immutable
#2099702 ·published 2012-01-05 18:44 UTC
rendered paste body
//This breaks on the second time around for unknown reasons

        private void Computer_Read()
        {
            //ComputerLevels.Count() reads as 1 the first time and 2 the second time. 
            int Read_Length = ComputerLevels.Count();     

            for(int Read_Progress = 0; Read_Progress < Read_Length; Read_Progress++)
            {
                //Writing Debug.WriteLine(Read_Progress); here shows only 0, showing the for loop only
                runs once.

                //Writing Debug.WriteLine(Read_Length); here shows 1 the first time, then 2 the second time,
                so why is the for loop being broken out of when Read progress (only coming out as 0 is < (smaller
                than)Read Length (first 1, then 2) 

 
                foreach (Panel panel in Buttons)
                {
                    if (ComputerLevels[Read_Progress] == panel.Name)
                    {
                        flash(panel);
                    }
                }
                Read_Progress++;
            }
        }