Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Avoiding 'Cannot Quit Visual Foxpro' on Shutdown

Tips -N- Tricks

Avoiding 'Cannot Quit Visual Foxpro' on Shutdown

by  craigsboyd  Posted    (Edited  )
Slighthaze = [color blue]NULL[/color]

[img http://www.sweetpotatosoftware.com/ttimages/shutdown.gif]

Create a procedure in your main.prg as follows:

PROCEDURE PropShutdown()
ON SHUTDOWN
*!*Any other clean up code you may want goes here
QUIT
ENDPROC


...Alternate procedure would be

PROCEDURE PropShutdown()
ON SHUTDOWN
*!*Any other clean up code you may want goes here
IF _vfp.StartMode = 0
Cancel
ELSE
QUIT
ENDIF
ENDPROC


...this alternate takes in to consideration that you don't want the VFP IDE to close down when you are debugging the system.

...and then the last thing you need to do is near the very top of your main.prg put the line:

ON SHUTDOWN DO PropShutdown
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top