Respond to Selection in answer box

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
macthorman
Posts: 7
Joined: Tue Nov 20, 2012 9:30 pm

Respond to Selection in answer box

Post by macthorman » Tue Nov 20, 2012 9:38 pm

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

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Respond to Selection in answer box

Post by bn » Tue Nov 20, 2012 9:56 pm

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

macthorman
Posts: 7
Joined: Tue Nov 20, 2012 9:30 pm

Re: Respond to Selection in answer box

Post by macthorman » Tue Nov 20, 2012 11:20 pm

Thank you Bernd, that's exactly what I was looking for.

Post Reply