Re:loops
Re:loops
- Subject: Re:loops
- From: Michelle Steiner <email@hidden>
- Date: Thu, 14 Feb 2002 12:32:59 -0700
On, Thu, 14 Feb 2002 08:59:36 -0800, Ed Stockly
<email@hidden> wrote:
>
repeat 3 times
>
--stuff
>
end repeat
>
>
In this example the script inside the loop would execute the number of times
>
specified, then go on to the rest of the script.
It should be pointed out that with this use of repeat, the code inside
the loop has no knowledge of which iteration the loop is in.
>
repeat
>
--stuff
>
--if someCondition is true then exit repeat
>
end if
>
>
In this example the loop would repeat forever (an infinite loop) until a
>
particular condition is true then it would exit the loop and go on to the
>
next line of AppleScript
This best used when there are multiple conditions that could trigger the
criteria to exit the loop. This is because there are two other repeat
syntaxes to evaluate one-criterion conditions.
repeat until <condition>
-- stuff
end repeat
This starts out with a false condition and the loop continues until the
condition becomes true.
repeat while <condition>
stuff
end repeat
This starts out with a true condition and the loop continues until the
condition becomes false.
--Michelle
_______________________________________________
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: | |
| >Re:loops (From: Ed Stockly <email@hidden>) |