• 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: Resetting a repeat loop counter on the fly
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Resetting a repeat loop counter on the fly


  • Subject: Re: Resetting a repeat loop counter on the fly
  • From: Mr Tea <email@hidden>
  • Date: Tue, 26 Nov 2002 19:28:16 +0000

This from John C. Welch - dated 26-11-02 3.24 pm:

> Is there any way to change the value of a repeat loop counter within the
> repeat loop?

Not, I think, if you've set the number of repeats directly (eg, 'repeat 5
times...'), but you could try something like this:

set x to 0
set y to 2
repeat until x > y
set theDialog to "x = " & x & "
y = " & y & "
New value for 'y'?"
set theResponse to display dialog theDialog buttons {"+2", "-1", "No"}
if the button returned of the result is "+2" then
set y to y + 2
else if the button returned of the result is "-1" then
set y to y - 1
end if
set x to x + 1
end repeat


HTH


Mr Tea
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Resetting a repeat loop counter on the fly (From: "John C. Welch" <email@hidden>)

  • Prev by Date: Re: Detecting if text is styled
  • Next by Date: Kindershell WAS Re: lock the screen from the keyboard, win a prize
  • Previous by thread: Resetting a repeat loop counter on the fly
  • Next by thread: Re: Resetting a repeat loop counter on the fly
  • Index(es):
    • Date
    • Thread