You Can Use ACTIVATE MENU _msysmenu Instead of Foundation READ

Last reviewed: June 27, 1995
Article ID: Q129505
The information in this article applies to:
  • Microsoft FoxPro for Windows, version 2.6a
  • Microsoft FoxPro for MS-DOS, version 2.6a
  • Microsoft FoxPro for Macintosh, version 2.6a
  • Microsoft FoxPro for UNIX, version 2.6

SUMMARY

Some developers don't want to use a Foundation READ because a Foundation READ uses one read level in FoxPro, which leaves only four read levels. This article shows how to create an interactive program without using a Foundation READ. However, it also has a draw back in that the menu is always selected when nothing else has the focus.

MORE INFORMATION

To accomplish a non-Foundation READ event loop:

  1. Set up a main program that will have a DO WHILE loop in it as in the following example of a simple main program:

    MAIN.PRG m.done = .f. DO mymenu.mpr && This is your menu. DO WHILE .NOT. m.done

          ACTIVATE MENU _msysmenu
    
    ENDDO

  2. Modify your menu to have an option that will get you out of the loop. For example, create a menu procedure that contains this command:

    m.done=.T.

Explanation of Code

The ACTIVATE MENU _msysmenu holds up the application by activating the menu. Control is not returned to the DO WHILE loop until a menu option is selected or the menu looses focus.

To exit the program and return control to FoxPro (returning to the command window or to quit in an executable), you need a menu option that has a procedure to set the variable m.done to true. This allows the program an exit from the DO WHILE loop.

This method of Keeping FoxPro interactive does not consume a read, however the menu is always being Activated, so it will be highlighted.


Additional reference words: FoxWin FoxDos FoxMac FoxUnix 2.60a
KBCategory: kbprg kbcode
KBSubcategory: FxprgGeneral


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.