Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

Quit Method

This method shuts down the VFP application server.

Usage

_VFP.Quit()
Application.Quit()
oVFPObject.Quit()

You can address Visual FoxPro as an Automation server. When you do so, the Quit Method lets you close the server. It’s the Automation equivalent to the Quit command.

As the syntax diagram shows, you can also use Quit with the _VFP and Application references to the currently executing VFP session. Of course, doing so abruptly ends that session.

Unlike the Quit methods of some other Automation servers, VFP’s Quit Method doesn’t provide a way for you to indicate what should happen to unsaved changes. So, issuing the Quit Method when files are open for editing (in the development environment) generates a series of “Do you want to save changes …” dialogs.

Calling this method fires any ON SHUTDOWN routine. If you’re trying to do something totally behind the scenes, make sure that the ON SHUTDOWN routine doesn’t call for user interaction.

Quit isn’t available to your custom Automation servers because you normally would not want to expose the Application Object. Create your own custom Quit routine if you need one as part of your server.

Example

oVFP = CreateObject("VisualFoxPro.Application")
oVFP.Quit()

See Also

Application, On Shutdown, QueryUnload, Quit, _VFP