Inkey Vfp

  1. Vfp9 Inkey
  2. Inkey Pms Update
  3. Funcion Inkey Vfp
-->

Formadmirer asked on 2013-08-04. FoxPro; 3 Comments. Last Modified: 2013-08-05. I have a textbox where I have the inkey. Comparison of character data type, aka comparison of strings is the most confusing one in VFP. It doesn't work as in other languages and/or databases and unique to VFP (and maybe to some other xBase language). Many years back, I have even seen some really advanced members in the community who weren't yet aware how these operators work in VFP.

  • It generally won't fire until VFP enters a wait state. A wait state is anything that waits for user input - inkey, displaying a browse window, editing data, etc., pretty much anything where the app is waiting for the user to do something - which is probably 99.999% of the time.
  • For 10 seconds before it quits. It could be that the =inkey(1) may be used for a one second delay. This is only my guess. Why it errors out I do not know. Tony Hello, I have inheritted some code. This program is written in Visual FoxPro 6.0. The function inkey is used in several areas of the program and I still have not been able to figure.

Vfp9 Inkey

Funcion inkey vfpInkey Vfp

This article describes how to use KeyPress Event for form controls.

Original product version: Visual FoxPro
Original KB number: 140296

Summary

Many developers use ON KEY LABEL to assign programs or procedures within programs that are to be executed upon pressing a specific key (usually a function key). However, if the ON KEY LABEL assignment is to be specific to a control within a form, a better alternative would be to use the KeyPress event of that control.

Part

More information

The KeyPress event is available for the following form controls:

CheckBox, ComboBox, CommandButton, EditBox, Form, ListBox, OptionButton, Spinner, TextBox

It is possible to use this event to check for the press of a specific key. When using the KeyPress event to perform an action based on a function key, the function key's value should be used as shown in this table:

For more information on key values, see the INKEY() function in Visual FoxPro Help file.

Step-by-Step Example

The following steps show how to use the KeyPress event.

Inkey Pms Update

Pms

Funcion Inkey Vfp

  1. Create a form, and place a text box on it.

  2. In the ControlSource property of the text box, type mykey (or any other variable that you might prefer).

  3. Place the following code in the KeyPress event of the text box:

  4. Place the following code in the Load event of the form:

  5. Place the following code in the Destroy event of the form:

  6. Place a command button on the form, and place the following code in its click event:

  7. Save and run the form. If either the F1 or F5 key is pressed, the appropriate WAIT WINDOW messages should appear, and the text box should be updated.