KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Working around the Close box standard behavior
PRODUCT: 4D | VERSION: 6.7 | PLATFORM: Win
Published On: March 27, 2002

On Windows, clicking on the Close box of a 4D application will close the application. This is the standard behavior for a Windows application, but you may want to alter it.

To alter this behavior, use the following work-around:


- Before quitting the database, 4D always run the On Exit method. Add the following code in that method:

Repeat


 IDLE

Until (<>Quit4D)


- In the On Startup method, add the following statement to initialize the <>Quit4D variable:

C_BOOLEAN (<>Quit4D)


<>Quit4D := False


When someone tries to quit the application using the close box, the application will loop in this process until <>Quit4D becomes False. No matter what, the application will not quit until <>Quit4D is set to True. To quit, you just need to set <>Quit4D to TRUE before executing the QUIT 4D command.