devxlogo

EXE Starts and Ends Immediately

EXE Starts and Ends Immediately

Question:
When I build my application as an EXE and run it, the application comes up and then immediately disappears.

What is wrong?

Answer:
You need to create an event loop that will hold your application in memory until you leave the application (choosing File | Exit, for example).

The command called READ EVENTS does exactly what you need. You need to put a READ EVENTS into your code, right after the code that sets up the menu and the environment.

Now you need a way to get out of that event loop when you want to leave the application. Visual FoxPro has a CLEAR EVENTS command that will end the event loop. Put a CLEAR EVENTS into the code that tells your app to end (in the menu item File | Exit, for example).

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist