INF: Menu Flashes on Screen, Then Returns to MS-DOS Prompt
PSS ID Number: Q102929
Article last modified on 08-25-1994

2.50    | 2.00 2.50

WINDOWS | MS-DOS


--------------------------------------------------------------------
The information in this article applies to:

 - Microsoft FoxPro Distribution Kit for Windows, version 2.5
 - Microsoft FoxPro Distribution Kit for MS-DOS, versions 2.0 and 2.5
--------------------------------------------------------------------

SYMPTOMS
========

When a stand-alone executable file is created with the .MPR file as
the main program and is then run, it immediately returns to the MS-DOS
prompt after briefly flashing the menu. This behavior indicates that
the menu code has been run but has not been kept in an event loop.
(This problem is most noticeable in FoxPro for MS-DOS.)

CAUSE
=====

When a menu is generated, running the .MPR file does not put you in an
event loop or a wait state.

RESOLUTION
==========

To be in an event-driven loop, use a READ command with a VALID clause
that calls an event handler.

NOTE: For examples, refer to FOXPROW\SAMPLE\ORGANIZER\FAMILY.PJX or
FOXPRO2\GOODIES\FNDATION\INV.PJX. The IDLEREAD.PRG program in
FAMILY.PJX uses a READ VALID command to keep the family application in
an event-driven loop.

REFERENCES
==========

FoxPro for Windows Distribution Kit "User's Guide," version 2.5, "Menu
Programs and Foundation READs"

Additional reference words: 2.00 2.50 foundation read drop through

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

Copyright Microsoft Corporation 1994.
