PDA

View Full Version : Example: Prompt the user for confirmation before exiting


Desmond
10-17-2005, 09:25 AM
Hello,

Originally posted by Worm (http://www.indigorose.com/forums/showthread.php?t=13407), use this technique to prompt your users to confirm they want to exit before your application actually closes. The following function is automatically called whenever the close (x) button is pressed, or Application.Exit is used.

For more information, please consult our online help file (http://www.indigorose.com/webhelp/ams60/Program_Reference/Projects/Globals/Globals_-_Built_In.htm).

function QueryAllowProjectClose()
result = Dialog.Message("Exit Application?", "Would you like to exit the application?", MB_YESNO, MB_ICONEXCLAMATION, MB_DEFBUTTON1);

--the no button was pressed
if result == 7 then
--cancel exit
return false;
else
--allow exit
return true;
end
end