MMF2 - Saving File at End of Application
I have code at in my application so that when the user selects to exit the application a message box comes up and asked if they want to save a file that is displayed. If no the application ends. If yes the file is to be saved.
However, the file is never saved.
The code is:
When user selects menu option "Exit Application"
Then Show Message Box.
If "Yes" is selected in Message Box
then save the file then end the application.
Any suggestions?
Re: MMF2 - Saving File at End of Application
How are you saving your file and perhaps you need to check to make sure the file gets saved prior to exiting the app.
I know the built in save frame position you need to use the condition file is saved before you end the application.
Re: MMF2 - Saving File at End of Application
Make a new menu item which doesn't automatically close the application and then use the "End Application" action when you want it to end.
However, this does not help if they clicked the cross on the title-bar.
Re: MMF2 - Saving File at End of Application
You could also change the condition to "close window has been selected."
stephen1980
Re: MMF2 - Saving File at End of Application
End of Application works kinda like a loop. IN fact you can run loops while your application is closing if you do it right.
The trick is to add the condition "End of Application" at the top of all the conditions that you want to check at the end of app. Including the one that checks for the message box button.
However there is a catch. The conditions after the "End of Application" have to be repeatable. They can't be one time events. So in order to check what button is pressed using the message box object use this code for the "Yes" button.
getLastMessageBoxButtonID( "MessageBox object" ) = 9
Here's a screenshot of the condition:
http://www.jsoftgames.com/exampleendcheck.bmp