Exiting a repeat loop
Exiting a repeat loop
- Subject: Exiting a repeat loop
- From: Marc Glasgow <email@hidden>
- Date: Thu, 25 May 2006 12:56:24 -0400
Try constructing it this way:
set AllowExit to False as boolean
repeat while (Not (AllowExit))
-- do whatever in the loop, as long as it changes AllowExit to False
as Boolean
end repeat
Cheers
=-= Marc Glasgow
CyberPoet.NET
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
TIA,
_______________________________________________
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