Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.
READ EVENTS
, CLEAR EVENTS
These are the commands that hook your forms into the native event loop of Visual FoxPro, as we describe in “A Gala Event.” Despite their inclusion in the READ and CLEAR help topics, these commands are best left by themselves, without the extra paraphernalia of the older READ model. READ EVENTS
MODAL TIMEOUT 15, for example, while accepted by FoxPro as a valid command, does not time out and does not act modally.
The right way to use READ EVENTS
is to issue the command after your application has started up and established its environment, custom menu and global settings. When your application is done, issue CLEAR EVENTS
to release your code from the suspended animation of the READ EVENTS
event loop, and then your code can proceed to close out all open forms, and close out your application.
READ EVENTS && start event loop processing
CLEAR EVENTS && end event loop processing