with qualifying of any of the return sattement do the loop break groovy -


do loop terminates when qualifies return statement? when value null?

your question vague answered kind of certainty. hazard guess, however, i'd bet you're referring control statements within '.each' loop?

if so, short answer is: no, return (or break) not terminate loop. way via throwing exception within loop à la:

try{     (1..10).each{ n->         println n         if (n == 5) throw new exception()        } }         catch(exception){} 

but, total abomination. use or while loop instead.

see also: returning closure

if i'm off mark, perhaps post code exemplifying topic?


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -