title: How to `continue` or `break` in a `when` statement inside a `while` loop using Kotlin
body: <p>I am converting a large project to Kotlin. There have been numerous challenges.  Me learning the new patterns of Kotlin is one of them.  Hopefully there is a pattern I can use to resolve this one.</p>
  
  <p>Here is the code I am attempting to achieve.  But, <code>continue</code> and <code>break</code> are not valid in a <code>when</code> statement.</p>
  
  <pre><code>while (!mStopped &amp;&amp; c.moveToNext()) {
  
      val itemType = c.getInt()
      when (itemType) {
          1, 2 -&gt; {
              doSomething()
              if (condition)
                  continue
              doSomethingElse()
          }
      }
      doTheLastStuff()
  }
  </code></pre>
  
  <p>This is a very cut-down version of the code.  The original java code had 100's of lines inside the switch statements, and lots of <code>continue</code>'s and <code>break</code>'s.</p>
  
  <p>What I am trying to achieve is to continue execution back at the <code>while</code> statement.  What is the pattern for doing this in Kotlin</p>