How to Use Function Keys as Shortcuts in Menus

Last reviewed: April 18, 1995
Article ID: Q106706
The information in this article applies to:
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a, and 2.5b

SUMMARY

To use function keys F2 through F9 as direct shortcuts to menu bars (menu options), you must first disable the default macro assignment for these keys either through the Command window or a program, or through the CONFIG.FP file, as described below.

MORE INFORMATION

By default, FoxPro initiates the following macro assignments for function keys F2 through F9:

   F2: Set
   F3: List
   F4: Dir
   F5: Display Structure
   F6: Display Status
   F7: Display Memory
   F8: Display
   F9: Append

Before you can use these function keys as shortcuts to menu bars, you must first remove the default macro assignment for the function keys.

Clearing Function Keys in the Command Window or in a Program

To clear individual function keys, you can use the SET FUNCTION command with no expression following the TO clause. For example, to clear the F2 key, issue the following command:

   SET FUNCTION F2 TO

This command clears the default assignment, thus allowing the menu to accept the function key as a shortcut for a menu bar or pad.

To clear all macro assignments, issue the CLEAR MACROS command.

Clearing Function Keys in the CONFIG.FP File

To clear individual function keys in the CONFIG.FP file, do the following:

  1. Issue the following command in the Command window:

          MODIFY FILE <path>\config.fp
    

  2. Assign the function key to a null expression. For example, to clear the F2 key, type the following in the CONFIG.FP file:

          F2 = ""
    

To clear all the function key assignments, type the following in the CONFIG.FP file:

   COMMAND = CLEAR MACROS

Since you can issue the COMMAND = statement only once in the CONFIG.FP file, if you need to issue more than one command when FoxPro starts, put all the commands in a program. Assuming this program is called MAIN.PRG, type the following in the CONFIG.FP file:

   COMMAND = DO main

REFERENCES

"Language Reference," version 2.5, page L3-931


Additional reference words: FoxDos 2.00 2.50 2.50a 2.50b item command
KBCategory: kbprg
KBSubcategory:


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: April 18, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.