Microsoft KB Archive/103276

From BetaArchive Wiki

MRKPAD() Example Does Not Work in FoxPro for Windows

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


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