title: Change if statement from variable
body: <p>Not sure if the question is correct, but here is what I am trying to accomplish.</p>
  
  <p>I am running a for-loop in which i want to change the if-statement in each loop.</p>
  
  <p>Here is the example:</p>
  
  <pre><code>for(int i=0;i&lt;3;i++){
  
      int currentField = field;
  
      var context1=currentField;
      int curprogr=0;
  
      switch (i){
      case 0:
          context1 = currentField % 10 != 0;
          curprogr = 1;
          break;
      case 1:
          context1 = Mathf.Floor(currentField/10) != 0;
          curprogr = 10;
          break;
      case 2:
          context1 = currentField % 10 != 0 &amp;&amp; Mathf.Floor(currentField/10) != 0;
          curprogr = 11;
          break;
      }
  
      while(context1){ // Here is where I want it to chnage for each time the loop runs through //
          // Some logic here... //
      }
  }
  </code></pre>
  
  <p>I get this error: Cannot implicitly convert type <code>bool' to</code>int' in every switchcase in regards to the context1.</p>
  
  <p>Hope this makes sense and any help is appreciated.</p>
  
  <p>Thanks in advance</p>