Break a Loop (for each loop)


How can I break a for each loop ?
I tried to set the value of number to 5 when the condition in if-else is meet but I get this error


Currently, you can’t. However, MIT are working on adding a block for this.


Okay thanks for the response :grinning:


I don’t think you posted the blocks for this?

I also don’t think it’s a problem with the loop. Looks more like a problem with an image.


yeah my bad, but anyway thank you :grinning:
I found an extension for this :grin:


You can set a variable to true and when you have the break condition set it to false.
At the beginning of your loop, check that variable and if is false the loop do nothing. So the loop go trough anyway but doesn’t do elaboration.


Okay I’ll try that
thanks for the idea:grinning: