It can be done like this with a return, for example
1 to: 10 do: [:each | (each = 1) ifTrue: [^'Found it!']. The caret makes you "exit"
----------------- Benoît St-Jean Yahoo! Messenger: bstjean Twitter: @BenLeChialeux Pinterest: benoitstjean Instagram: Chef_Benito IRC: lamneth Blogue: endormitoire.wordpress.com "A standpoint is an intellectual horizon of radius zero". (A. Einstein)
On Friday, November 17, 2017, 12:21:20 AM EST, RedTigerFish chihuyu@gmail.com wrote:
In C loop, there is break method which allows the program to jump out of the loop when certain criteria has been met.
What is the counterpart in Smalltalk if there's one?
----- Dig, dig where you are, Down below's well. Let those that walk in darkness shout, Down below's hell. -- Sent from: http://forum.world.st/Squeak-Beginners-f107673.html _______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners