MRKPAD() Example Does Not Work in FoxPro for Windows

Last reviewed: June 27, 1995
Article ID: Q103276
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.5 and 2.5a

SUMMARY

Page L3-685 of the "Language Reference" manual states "The following example uses MRKPAD() to toggle the mark character of a menu pad when you choose it." However, this example does not work correctly in FoxPro for Windows.

MORE INFORMATION

The FoxPro for Windows system menu cannot display mark characters, demonstrating similar behavior to other Windows-based applications. To view the mark characters, you must use a menu name other than _msysmenu.

The following program is a modified version of the example on page L3-686 of the "Language Reference." It works as expected in FoxPro for Windows.

   *** Name this program MARKPAD.PRG  ***

   CLEAR

   SET SYSMENU SAVE
   SET SYSMENU TO

   ****This line must be added
   DEFINE MENU mainmenu

   SET MARK OF MENU mainmenu TO CHR(4)
   PUBLIC markpad
   markpad = .T.

   ***** _msysmenu must be changed to mainmenu
   DEFINE PAD syspad    OF mainmenu PROMPT '\<System' ;
       COLOR SCHEME 3 KEY ALT+S, ''
   DEFINE PAD editpad   OF mainmenu PROMPT '\<Edit' ;
       COLOR SCHEME 3 KEY ALT+E, ''
   DEFINE PAD recordpad OF mainmenu PROMPT '\<Record' ;
       COLOR SCHEME 3 KEY ALT+R, ''
   DEFINE PAD windowpad OF mainmenu PROMPT '\<Window' ;
       COLOR SCHEME 3 KEY ALT+W, ''
   DEFINE PAD reportpad OF mainmenu PROMPT 'Re\<ports' ;
       COLOR SCHEME 3 KEY ALT+P, ''
   DEFINE PAD exitpad   OF mainmenu PROMPT 'E\<xit' ;
       COLOR SCHEME 3 KEY ALT+X, ''

   ON SELECTION MENU mainmenu ;
      DO choice IN markpad WITH PAD( ), MENU( )

   **** Turn off the System Menu
   SET SYSMENU OFF
   **** Activate user defined menu
   ACTIVATE MENU mainmenu

   **** Restore System Menu
   SET SYSMENU ON
   SET SYSMENU TO DEFAULT

   PROCEDURE choice
   PARAMETER mpad, mmenu

   WAIT WINDOW 'You chose ' + mpad + ;
      ' from menu ' + mmenu NOWAIT
   SET MARK OF PAD (mpad) OF mainmenu TO ;
      ! MRKPAD('mainmenu', mpad)
   markpad = ! markpad

   IF mpad = 'EXITPAD'
      DEACTIVATE MENU mainmenu
   ENDIF


Additional reference words: FoxWin 2.50 2.50a
KBCategory: kbprg
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.