Page 1 of 1

Shut down request.

Posted: Sat Feb 03, 2007 12:18 am
by stuartls
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.

Posted: Sat Feb 03, 2007 4:19 am
by Mark
Stuart,

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

Best,

Mark

Posted: Sat Feb 03, 2007 4:45 am
by stuartls
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

Posted: Sat Feb 03, 2007 5:05 am
by Mark
Stuart, you asked "why isn't this working?". What exactly makes you say that it isn't working?

Mark

Posted: Sat Feb 03, 2007 1:30 pm
by xApple
"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).

Posted: Sat Feb 03, 2007 2:28 pm
by Mark
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