Page 1 of 1

Respond to Selection in answer box

Posted: Tue Nov 20, 2012 9:38 pm
by macthorman
Hey guys,

I have a very basic question related to the "answer" command. I looked it up in the dictionary and created a popup "yes" or "no" answer box and I want to execute different functions depending on the user's choice. So this is what I got

Code: Select all

answer "Are you sure you want to continue" with "Yes" or "No"
My question is now, how can i respond to this selection. Something like: if the answer is "Yes" then .....

Can your pelase tell me how the syntax would look like or where I can find the ressources?

Thomas

Re: Respond to Selection in answer box

Posted: Tue Nov 20, 2012 9:56 pm
by bn
Hi Thomas,

from the dictionary:
The name of the button the user chooses is placed in the it variable.

Code: Select all

answer "Are you sure you want to continue" with "Yes" or "No"
if it is "Yes" then
doyourYesStuffhere
end if
if it is "No" then
doYourNoStuffHere
end if
Kind regards
Bernd

Re: Respond to Selection in answer box

Posted: Tue Nov 20, 2012 11:20 pm
by macthorman
Thank you Bernd, that's exactly what I was looking for.