Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual FoxPro
Expertise: Beginner
Sep 22, 2000

Cannot Quit FoxPro

Question:
I have built an executable file and included a READ EVENTS command. After running the .exe, I am unable to quit VFP. The message I get reads: "Cannot quit FoxPro."

Answer:
VFP cannot quit when a READ EVENTS command is active. Therefore you must perform a CLEAR EVENTS before the QUIT command when you want to leave an application. Users can also try to end a VFP application by clicking on the close box on the application window. Therefore you will need to trap this by putting a CLEAR EVENTS command into the ON SHUTDOWN routine of the application.

Create a program with the following code, compile it to an EXE, and run the EXE. Click on the close box of the application to test the ON SHUTDOWN behavior:

ON SHUTDOWN Do MyShutDownRoutine
ON KEY LABEL F2 CLEAR EVENTS
wait wind nowait "Press F2 to clear events"
READ EVENTS

PROC MyShutDownRoutine
CLEAR EVENTS
ENDPROC
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap