Re: Exit Repeat
Re: Exit Repeat
- Subject: Re: Exit Repeat
- From: Deivy Petrescu <email@hidden>
- Date: Fri, 02 Oct 2015 13:06:07 -0400
> On Oct 2, 2015, at 12:23 , Jon Rosen <email@hidden> wrote:
>
> Am I incorrect about this? As far as I can tell, there is no way exit from an individual loop of a repeat block; you can only exit from the entire block. I found a workaround using nested repeat loops, which works, but it seems kludgy to me. Is there a more elegant way to do this?
>
> — Jon
More or less in the vein of what Alastair mentioned
repeat with j from 1 to 10
if j = 5 then
set j to 5
else
log j
end if
end repeat
obviously, it would have to be adapted to whatever situation you have at hand.
Also, depending on the conditions a negation of the equality would work well.
Now, is this more elegant?
This is in the eyes of the scripter.
Deivy Petrescu
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
References: | |
| >Exit Repeat (From: Jon Rosen <email@hidden>) |