Dave's Brain

Browse - Programming Tips - How can I break out of a loop?

Date: 2013aug27
Language: Scala

Q.  How can I break out of a loop?

A.  Scala 2.8 added the "break" keyword.  Example use:

import scala.util.control.Breaks._ for (;;) { if (something) break; }
But this is discouraged. Still no "continue" keyword.

Add a comment

Sign in to add a comment
Copyright © 2008-2018, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.