Answer with "No" or "Yes" ... quit on Yes

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
DaveyJJ
Posts: 15
Joined: Sat Aug 25, 2007 8:38 pm
Location: Waterloo, Ontario
Contact:

Answer with "No" or "Yes" ... quit on Yes

Post by DaveyJJ » Sat Apr 20, 2013 12:44 am

My 11 year old and I can not figure out how to quit the app when a user clicks the "Yes" button in our answer sheet.

Code: Select all

// user clicks the quit button
on mouseUp
answer "Really quit" with "No" or Yes" as sheet
// clicking "Yes" causes the app to quit
// if "yes"
// then quit
end mouseUp
That's basically what we want to do. We've tried every imaginable permutation of this simple if statement and can't get the Yes button to respond. Thank you.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3975
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Answer with "No" or "Yes" ... quit on Yes

Post by bn » Sat Apr 20, 2013 12:55 am

Hi Davey,

what the user chose in an answer dialog is in "it"

Code: Select all

// user clicks the quit button
on mouseUp
   answer "Really quit" with "No" or "Yes" as sheet
   // clicking "Yes" causes the app to quit
   if it is "yes" then quit
end mouseUp
Kind regards
Bernd

DaveyJJ
Posts: 15
Joined: Sat Aug 25, 2007 8:38 pm
Location: Waterloo, Ontario
Contact:

Re: Answer with "No" or "Yes" ... quit on Yes

Post by DaveyJJ » Sat Apr 20, 2013 12:58 am

bn wrote:Hi Davey,

what the user chose in an answer dialog is in "it"

Code: Select all

// user clicks the quit button
on mouseUp
   answer "Really quit" with "No" or "Yes" as sheet
   // clicking "Yes" causes the app to quit
   if it is "yes" then quit
end mouseUp
Kind regards
Bernd
Thank you so much!

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”