Quitting while saving changes
Posted: Tue Sep 21, 2010 1:32 am
I would like my stand alone application to save the changes to the various datagrids in it. In the development mode it always seems to save everything. As a standalone it does not save anything. On an application quit or the close of the main stack, I would like to offer a chance to save, not save or cancel the quit. My application has a splash stack and a main stack with a few substacks. It is the data in the main stack I would like to be saved or not as the user chooses.
I have code that looks like this in the script for the main stack:
The lines which are commented out have been tried in various combinations but I can't seem to get it right.
Suggestions or references to documentation would be appreciated.
Thanks,
Larry
I have code that looks like this in the script for the main stack:
Code: Select all
on CloseStackRequest
answer question "Do you want to save database changes?" & return & return & \
"(Web changes are already in effect.)" with "No" or "Cancel" or "Yes" titled "Application Close"
if it is "Yes" then
save this stack
--pass closeStackRequest
--quit
close this stack
else
if it is "NO" then
--pass closeStackRequest
--quit
close this stack
else
exit closeStackRequest
end if
end if
end CloseStackRequest
on shutDownRequest
send "closeStackRequest" to stack "DAStoPF"
pass shutDownRequest
end shutDownRequest
Suggestions or references to documentation would be appreciated.
Thanks,
Larry