exit repeat and nested repeats
Andrew Kluthe
andrew at ctech.me
Thu Aug 1 16:43:28 EDT 2013
Great, thanks for the info. I was trying to eliminate some problems from
one of my data processing routines and I was trying to figure out if this
could be to blame. It is not. This works as I expected to with the exit
only affecting the repeat that contains it.
Regards,
Andrew
On Thu, Aug 1, 2013 at 3:41 PM, Mark Schonewille <
m.schonewille at economy-x-talk.com> wrote:
> Hi Andrew,
>
> You can use a variable if you want to exit all repeat loops:
>
>
> repeat for each key sKey in sData
> repeat for each key sKey2 in sData[sKey]
> put true into myExitAll
> exit repeat
> end repeat
> if myExitAll then
> exit repeat
> end if
> end repeat
>
> Or use a separate handler:
>
> on twoRepeatLoops
>
> repeat for each key sKey in sData
> repeat for each key sKey2 in sData[sKey]
> exit twoRepeatLoops
> end repeat
> end repeat
> end twoRepeatLoops
>
> --
> Best regards,
>
> Mark Schonewille
>
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/**xtalkprogrammer<http://twitter.com/xtalkprogrammer>
> KvK: 50277553
>
> Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other colour
> spaces. http://www.color-converter.com
>
> Buy my new book "Programming LiveCode for the Real Beginner"
> http://qery.us/3fi
>
> Fill out this survey please
> http://livecodebeginner.**economy-x-talk.com/survey/<http://livecodebeginner.economy-x-talk.com/survey/>
>
>
> On 8/1/2013 22:22, Andrew Kluthe wrote:
>
>> How does exit repeat handle nested repeats? Does it exit the parent repeat
>> if called from a child repeat in two repeats that are nested in a handler?
>>
>> repeat for each key sKey in sData
>> repeat for each key sKey2 in sData[sKey]
>> exit repeat
>> end repeat
>> end repeat
>>
>>
>>
>>
> ______________________________**_________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode>
>
--
Regards,
Andrew Kluthe
andrew at ctech.me
More information about the use-livecode
mailing list