• 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: "Arthur J. Knapp" <email@hidden>
  • Date: Tue, 26 Nov 2002 13:32:55 -0500

> Date: Tue, 26 Nov 2002 10:24:54 -0500
> Subject: Resetting a repeat loop counter on the fly
> From: "John C. Welch" <email@hidden>

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

No. Just create your own counter:

set i to 1
set n to 10

repeat
if ( resetting-test ) then

set i to 1

else if ( stopping-test ) then

exit repeat

else
-- do stuff

set i to i + 1 --> increment
end if
end repeat

Actually, we can simplify this:

set i to 1
set n to 10

repeat until i > n

if ( resetting-test ) then

set i to 1
else
-- do stuff

set i to i + 1 --> increment
end if
end repeat


{ Arthur J. Knapp, of <http://www.STELLARViSIONs.com>
a r t h u r @ s t e l l a r v i s i o n s . c o m
}
_______________________________________________
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.

  • Prev by Date: Re: (Repost) Distributing 'recreatored' script apps...
  • Next by Date: Re: Detecting if text is styled
  • Previous by thread: Re: [OT] Just screwing around
  • Next by thread: Re: Resetting a repeat loop counter on the fly
  • Index(es):
    • Date
    • Thread