• 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: Exiting a repeat loop if not false
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exiting a repeat loop if not false


  • Subject: Re: Exiting a repeat loop if not false
  • From: "John C. Welch" <email@hidden>
  • Date: Thu, 25 May 2006 06:48:40 -0500
  • Thread-topic: Exiting a repeat loop if not false

On 5/25/06 06:34, "Jay Louvion" <email@hidden> wrote:

>
> The following works only if I get it right the first time (entering 123, for
> ex.); If I type a false answer, i.e. ³qwertz², the repeat loop never exits,
> even when entering a correct answer afterwards. Is there a simpler way of
> doing this ?
>
> set AllowExit to true
> repeat
>     set OrderNum to ""
>     set OrderNum to text returned of (display dialog "Numéro de la commande
> (sans le \"LG\") ?" default answer "")
>     try
>         set OrderNum to (OrderNum as integer)
>     on error
>         set AllowExit to false
>     end try
>     if AllowExit is true then exit repeat
> end repeat

You need to set AllowExit to true for a correct answer. Currently, there's
nothing in the code to do that within the repeat loop. So once it's false,
it stays false.


--
 "To announce that there must be no criticism of the president, or that we
are to stand by the president, right or wrong, is not only unpatriotic and
servile, but is morally treasonable to the American public."
 -- Theodore Roosevelt, speaking on President Wilson's crackdown on dissent
after the U.S. entered W.W.I



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Exiting a repeat loop if not false (From: Jay Louvion <email@hidden>)

  • Prev by Date: Exiting a repeat loop if not false
  • Next by Date: whose clause with two conditions?
  • Previous by thread: Exiting a repeat loop if not false
  • Next by thread: Re: Exiting a repeat loop if not false
  • Index(es):
    • Date
    • Thread