I would suggest looking into Array.every or Array.some.

http://www.mootools.net/docs/core/Native/Array#Array:every
http://www.mootools.net/docs/core/Native/Array#Array:some

Example: http://mooshell.net/Krwy6/1/

On Sat, Dec 5, 2009 at 7:21 AM, Steve Onnis <[email protected]> wrote:

>  i saw mention of that when i googled.....i would rather not be creating
> errors on purpose. not a fan of hacks so just did it in a "for" loop. No
> biggie
>
>  ------------------------------
> *From:* Thierry bela nanga [mailto:[email protected]]
> *Sent:* Sunday, 6 December 2009 12:14 AM
> *To:* [email protected]
> *Subject:* Re: [Moo] Re: Break out of an each loop
>
> you could use try/catch to exit like this,
>
>
> http://mooshell.net/nM8SS/2/
>
>  <http://mooshell.net/nM8SS/2/>
>
> On Sat, Dec 5, 2009 at 1:54 PM, Kevin Valdek <[email protected]>wrote:
>
>> Except calling empty() on the array or collection each time you brake
>> is probably something you don't want to do.
>> Instead, consider using the good old for loop, where the break
>> statement works fine.
>>
>> http://mooshell.net/nM8SS/1/
>>
>> Kevin
>>
>> On Dec 5, 1:38 pm, Dirar Abu Kteish <[email protected]> wrote:
>> > What are you trying to do? if you have an array of any kind, you can set
>> a
>> > variable that simply say if you want to continue with the function or
>> not or
>> > do as in herehttp://mooshell.net/NcKYE/1/
>>  >
>> > On Sat, Dec 5, 2009 at 1:21 PM, Steve Onnis <[email protected]>
>> wrote:
>> > >  Is there a way to exit out of an each() loop?  i have tried "break"
>> but
>> > > doesnt work
>> >
>> > > Steve
>> >
>> > --
>> > Dirar Abu Kteish
>> > Zan Studio
>> > Web Development Manager
>> > Mob.:+970-597-100118
>> > website:www.zanstudio.com
>>
>
>
>
> --
> http://tbela99.blogspot.com/
>
> fax : (+33) 08 26 51 94 51
>

Reply via email to