Microsoft KB Archive/103276: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - "<" to "<")
 
(One intermediate revision by the same user not shown)
Line 11: Line 11:
== SUMMARY ==
== SUMMARY ==


Page L3-685 of the &quot;Language Reference&quot; manual states &quot;The following example uses MRKPAD() to toggle the mark character of a menu pad when you choose it.&quot; However, this example does not work correctly in FoxPro for Windows.
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 ==
== MORE INFORMATION ==
Line 17: Line 17:
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 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 &quot;Language Reference.&quot; It works as expected in FoxPro for Windows.
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.


<pre>  *** Name this program MARKPAD.PRG  ***
<pre>  *** Name this program MARKPAD.PRG  ***
Line 34: Line 34:


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



Latest revision as of 09:15, 20 July 2020

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.