• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Silly repeat question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Silly repeat question


  • Subject: Re: Silly repeat question
  • From: "email@hidden" <email@hidden>
  • Date: Thu, 26 Aug 2010 13:20:34 -0700

>
> On Aug 26, 2010, at 1:48 PM, Emmanuel LEVY wrote:
>
>> yes, so there are various tricks, mainly the "repeat 1" trick and the "error "next repeat" " trick:
>>

On Aug 26, 2010, at 12:32pm, Alex Zavatone wrote:

> Hmmm.  This doesn't seem much better than an if/then statement to check a condition.  Is it?  Am I missing something?


What could be better than an if/then statement?  When using a "next repeat" command there's bound to be a conditional expression somewhere.

Here's another illustration of the repeat 1 trick.

The Next repeat command (if such an animal existed in appleScript) would look like this:

		if foo < 0 then next repeat
And there wouldn't be a need for the inner repeat loop. But you would still need the if/then



repeat with x in {1, 2, 3, 5, 6, 7}
	repeat 1 times
		set foo to x - 5
		if foo < 0 then exit repeat
		display dialog x
	end repeat
end repeat



 HTH,

ES _______________________________________________
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

  • Follow-Ups:
    • Re: Silly repeat question
      • From: Alex Zavatone <email@hidden>
References: 
 >Silly repeat question (From: Alex Zavatone <email@hidden>)
 >Re: Silly repeat question (From: Nathan Greenstein <email@hidden>)
 >Re: Silly repeat question (From: Emmanuel LEVY <email@hidden>)
 >Re: Silly repeat question (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Re: Silly repeat question
  • Next by Date: Re: Silly repeat question
  • Previous by thread: Re: Silly repeat question
  • Next by thread: Re: Silly repeat question
  • Index(es):
    • Date
    • Thread