title: Using Switch statements with a for loop and mouse click to change data returned by case
body: <p>I am trying to use a switch statement return different columns when a user mouse clicks. Currently I have it set that when the click(toggle==0) return column 2 which works. Then when the toggle ==1 return column 0, this is where the code is not working. I would expect my dataMax and dataMin to change between case:0 and case:1. When I manually change it for case 0: I see the values change as I would expect. Below is my code:</p>
  
  <pre><code>FloatTable locationTable;
  FloatTable dataTable;
  float dataMin = MAX_FLOAT;
  float dataMax = MIN_FLOAT;
  int rowCount;
  int toggle = 0;
  void setup() {
  //   font = loadFont("Univers-Bold-12.vlw");
  //   textFont(font);
     size(650,400);
  dataTable = new FloatTable("povertynoheader.tsv");
     mapImage = loadImage("map.png"); 
     locationTable = new FloatTable("locations.tsv"); 
     rowCount = locationTable.getRowCount();
     // Read the data table.
         switch (toggle) {   
           case 0:
     // Find the minimum and maximum values.
     for (int row = 0; row &lt; rowCount; row++) {
       float value = dataTable.getFloat(row, 2);
       if (value &gt; dataMax) {
         dataMax = value;
       }
  
       if (value &lt; dataMin) {
         dataMin = value;
       } 
     }
     break;
     case 1:
        // Find the minimum and maximum values.
     for (int row = 0; row &lt; rowCount; row++) {
       float value = dataTable.getFloat(row, 0);
       if (value &gt; dataMax) {
         dataMax = value;
       }
  
       if (value &lt; dataMin) {
         dataMin = value;
       } 
     }
     break;
  
  void mousePressed() {
    if (toggle == 0 ) {
      toggle = 1;
  
    } else {
      toggle = 0;
    }
  }
  </code></pre>