Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One form application
Message
 
To
06/12/1999 13:57:00
Carlos Serrano
Sistemas Imagen S. A.
Guayaquil, Ecuador
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00299291
Message ID:
00299333
Views:
12
Here is what I was *really* looking for in the help file:, you have to be sure to put the form in an event loop.

===================================================

Controlling the Event Loop
Once the environment is set up and you've displayed the initial user interface, you're ready to establish an event loop to wait for user interaction.

To control the event loop

Issue the READ EVENTS command, which causes Visual FoxPro to begin processing user events such as mouse clicks and keystrokes.
It is important to place the READ EVENTS command correctly in your main file, because all processing in the main file is suspended from the time the READ EVENTS command is executed until a subsequent CLEAR EVENTS command is issued. For example, you might issue a READ EVENTS command as the last command in an initialization procedure, executed after the environment has been initialized and the user interface displayed. If you don't include the READ EVENTS command, your application will return to the operating system after running.

After the event loop has been started, the application is under the control of the user interface element that was last displayed. For example, if the following two commands are issued in the main file, the application displays the form Startup.scx:

DO FORM STARTUP.SCX
READ EVENTS

If you don't include a READ EVENTS command or its equivalent in your main file, your application will run properly from the Command window within the development environment. However, when you run it from your menu or main screen, the application will appear briefly, then quit.

Your application must also provide a way to end the event loop.

To terminate the event loop

Issue the CLEAR EVENTS command.
Typically, you issue the CLEAR EVENTS command from a menu or a button in a form. The CLEAR EVENTS command suspends the event processing for Visual FoxPro and returns control to the program that issued the READ EVENTS command that started the event loop.

For a simple program example, see Structuring a Program as a Main File later in this chapter.

Caution You need to establish a way to exit the event loop before you start it. Make sure your interface has a mechanism (such as an Exit button or menu command) to issue the CLEAR EVENTS command.
-- Larry Keyes
Remember only You can prevent Gray Goo. Never release nanobot assembers without replication limiting code.
Previous
Reply
Map
View

Click here to load this message in the networking platform