Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Real Basic Question
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00294983
Message ID:
00294992
Views:
18
>What is the proper way to verify if a user wants to quit an application? I have the following in my Destroy event, but I don't know what to do if they answer 'No'.
>
>TIA
>
>Answer=MessageBox("Are you sure you want to quit?",276,"Quit?")
>Do Case
>	Case Answer=6 && Yes
>		Close Tables all
>		Close DataBases All
>		Clear Events
>	Case Answer=7 && No
>		(What do I do here?)
>EndCase
>
Hi Alan,

I wouldn't put it in the Destroy. I have a method, ExitForm, in my form base class that I put code like this. I call it from any place the user can exit the form and/or the QueryUnload event. I return .T. if the user chooses to exit, .F. if not and take the appropriate action. E.g. if fired in the Queryunload, if the user says no, then I issue NODEFAULT in the Queryunload and return .F. There are probably plenty of other schemes in use, but this has worked well for me.

Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Previous
Reply
Map
View

Click here to load this message in the networking platform