title: Scala: for loop until condition
body: <p>How can I run <code>for</code> until a condition is met? Instead of using <code>scala.util.control.Breaks.break</code>, is it possible to test for a condition within <code>for</code>?</p>
  
  <pre><code>for(line &lt;- source.getLines) {
          if (line.equals("")) scala.util.control.Breaks.break
          Console print "Message&gt; "
          dataWriter.write(line, InstanceHandle_t.HANDLE_NIL)
        }
      } catch  {
          case e: IOException =&gt;{
  </code></pre>