Re: Exiting a repeat loop if not false
Re: Exiting a repeat loop if not false
- Subject: Re: Exiting a repeat loop if not false
- From: Bob Studer <email@hidden>
- Date: Thu, 25 May 2006 18:38:00 -0700
On May 25, 2006, at 4:34 AM, Jay Louvion wrote: 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
I think you might find this a little more elegant:
set OrderNum to "" repeat while OrderNum is "" 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 OrderNum to "" end try end repeat
-Bob
PGP: 0x5A969850 --------------------- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." -Brian Kernighan
|
_______________________________________________
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