Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize


Assigns an expression (keyboard macro) to a function key or key combination.

SET FUNCTION nFunctionKeyNumber | KeyLabelName TO [eExpression]



Specifies the number of the function key assigned to the macro. For example, use SET FUNCTION 2 to specify the F2 function key.


Specifies a key combination, including a function key, to which to assign the macro. Visual FoxPro supports key combinations that include function keys. You can use the CTRL or SHIFT key in combination with a function key to create additional programmable keys. For a list of key label expressions, see ON KEY LABEL.

TO [ eExpression]

Specifies the series of keystrokes stored to the function key or key combination. Visual FoxPro interprets a semicolon (;) in the expression as a carriage return.

Function key definitions can be cleared with CLEAR MACROS.

Community Additions

© 2015 Microsoft