Exiting the loop functioning

Is there a means of Ending or Existing the loop function that effectively ends the sketch? For example, playing a series of tones that could be ended by either exceeding a Do While parameter or by an input from the serial monitor.

You want to stop it for good?

while (true)
  { }  // loop forever

[quote author=Nick Gammon link=msg=2329552 date=1437801301] You want to stop it for good?

while (true)
  { }  // loop forever

[/quote] That, of course, doesn't actually stop it. It simply changes what it does.

The only way to really stop loop() is to disconnect the power.