Shut down request.

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
stuartls
Posts: 49
Joined: Mon Jan 22, 2007 10:59 pm
Contact:

Shut down request.

Post by stuartls » Sat Feb 03, 2007 12:18 am

Why doesn't this code work?

on mouseUp
answer "What would you like to do?" with "Cancel" or "Exit exam completely" or "Grade exam"
if it = "Grade exam"
then go to card Exit1
else
if it = "Exit exam completely"
then shutdown
end if
end mouseUp

The shutdown command is something I understand what I want it to do, but can't get the code to work. If I have three buttons on my popup as you can see in my "answer" portion is there an need to code the "cancel" button. it seems in my testing that upon selecting it that the dialog box dissappears anyway. I want my students to upon selecting "Exit exam completely" to have the program dissapear so to speak. No saving, just done.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sat Feb 03, 2007 4:19 am

Stuart,

What do you want to happen if the Cancel button is clicked?

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

stuartls
Posts: 49
Joined: Mon Jan 22, 2007 10:59 pm
Contact:

Post by stuartls » Sat Feb 03, 2007 4:45 am

Mark

Just cancel the "popup". But it seems like i said that leaving it blank and not having script to it does cancel it.

Stu

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sat Feb 03, 2007 5:05 am

Stuart, you asked "why isn't this working?". What exactly makes you say that it isn't working?

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

xApple
Posts: 113
Joined: Wed Nov 29, 2006 10:21 pm

Post by xApple » Sat Feb 03, 2007 1:30 pm

"Shutdown" is a message sent to the current stack when the application is quitting. The message is generated by the revolution engine itself. Sending it yourself will not do anything.

To trigger the exit of your stack use the "quit" command (notice the difference between commands and messages).

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sat Feb 03, 2007 2:28 pm

hi xApple,

You're right. I am a little surprised that using shutdown as a command doesn't cause an error message. The right command to use here is "quit". Stuart, make sure that the pocess doesn't remain in Windows' Task Manager after executing the quit command.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply