title: while loop within while loop within an else
body: <p>I have a <code>while</code> loop within an <code>else</code> statement. while the condition in the <code>while</code> loop is true I have the variable <code>k</code> decreasing (<code>k=k-1</code>). I want for the <code>while</code> loop to stop before <code>k==0</code>. I have tried placing the <code>while</code> loop within another <code>while</code> loop (<code>while k&gt;1</code>) thinking maybe that would cancel the inner loop if <code>k</code> dropped to <code>1</code>. Any thoughts?</p>
  
  <pre><code>if yada yada
      do thing1
  else
      while k&gt;1
          while x==true
              k=k-1;
              do thing2
          end
      end
  end
  </code></pre>