Re: Resetting a repeat loop counter on the fly
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.