title: help iterating through an arraylist full of objects using a "for" loop
body: <p>I have an arraylist which has a class datastructure.</p>
  
  <pre><code>public class empRec
  {
      public string nuView;
      public string firstName;
      public string position;
  }
  
  empRec records = new empRec();
  ...
  ...
  
  bar.add(records);
  </code></pre>
  
  <p>now if i want to access the elements i can use</p>
  
  <pre><code>foreach(empRec foo in bar) { ... }
  </code></pre>
  
  <p>this allows me to print out the values in my class.</p>
  
  <p>I do not know how to make this work using a for loop.  </p>
  
  <p>My end goal being to traverse the arraylist and find employee records and change some of the values.</p>
  
  <p>For example, if employeeNum is equal to the previous employeeNum check position id and change the position id.</p>