Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Read events
Message
From
04/08/2003 17:58:22
 
 
To
04/08/2003 14:13:18
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00816040
Message ID:
00816661
Views:
14
Kevin,
PMFJI, but where is the read events? Is it in the main.prg which calls your modeless form or is it in the activate event of the modeless form? If in the activate event, it is executing clear events then hitting activate event and re-executing read events. There should be only one place in your application that executes read events which should be from the main program that calls your main form or menu. Also, if you don't already use one, you should probably look into creating a "on shutdown" procedure that releases all active forms, closes all files, flushes buffers then executes the clear events. That way you can gracefully close the application from the exit button, the close button in the upper right hand corner of the main window, the exit menu option, or when Windows is shutting down. With an on shutdown procedure, you can avoid the "Cannot Quit Foxpro" message when shutting down Windows while your application is active. To exit, you would just execute "quit" from your exit button and as it is closing it will call the on shutdown procedure, do all specified cleanup actions and clear events to quit your application.


>>>I seem to need the read events command to start event processing, but through the years, my program craps out many times at this command which I issue in the main prg. What is the deal with the read events command? What actually is it for and why does it seem to give me so many problems?
>>
>>The READ EVENTS command will establish a sort of "infinite loop". It will wait for user input. When an event occurs, VFP will process it, but then go back to the READ EVENTS, and wait for further input.
>>
>>To quit this "loop", use CLEAR EVENTS somewhere, for instance, from the menu item "File | Quit" in your menu.
>
>
>Actually, that is where it will not exit the read events. I have an exit button on the form and I have clear events followed by a release thisform, but stepping through the code, when it hits the release thisform after the clear events, it rolls to my form.activate and stays at the read events and loops. Why would the clear events before the form release prevent this from occuring?
Previous
Reply
Map
View

Click here to load this message in the networking platform