Re: Certain Answer
Re: Certain Answer
- Subject: Re: Certain Answer
- From: Andrew Oliver <email@hidden>
- Date: Sat, 31 Jul 2004 21:00:09 -0700
I don't think there is a single 'correct' answer to this question. There are
multiple ways of achieving this. Which one you choose is as much personal
preference as anything else. For example:
Using 'exit repeat':
repeat
set dialog_reply to display dialog "Enter a number"
set dialog_text to text returned of dialog_reply
if dialog_text = "1" then
exit repeat
end if
end repeat
Using 'repeat until':
set gotAnswer to false
repeat until gotAnswer is true
set dialog_reply to display dialog "Enter a number"
set dialog_text to text returned of dialog_reply
if dialog_text = "1" then
set gotAnswer to true
end if
end repeat
Plus I'm sure there are others I can't think of off-hand.
Andrew
:)
On 7/31/04 8:40 PM, "Patrick Zittle" <email@hidden> wrote:
>
Hello,
>
What is the correct way to stop a repeat once a certain answer is
>
entered into a question dialog? I am asking a question and if the
>
answer is wrong it will ask the question again through a repeat command
>
but I want it to stop after the correct answer is put in. Any help is
>
appreciated!! Thanks!
>
_______________________________________________
>
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.
_______________________________________________
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.