0 to: 99 by: 1 do: [ :each | each = 50 ifTrue: [ ^self ] ]
----------------- 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, 1:00:34 AM EST, RedTigerFish chihuyu@gmail.com wrote:
*1 to: 130 do: [:i| ] * or *100 timesRepeat: [ ] *
Maybe because I learned some C before. I thought the above two are loops.
The following is "break" example in C. How to implement that in Smalltalk?
#include <stdio.h> void main() { for (int i = 0; i < 100; i++) if (i == 50) break; }
----- 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