How to Prevent Recursion Within ON KEY LABEL Routines (98754)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft FoxPro for Windows 2.5
- Microsoft FoxPro for Windows 2.5a
- Microsoft FoxPro for MS-DOS 2.0
- Microsoft FoxPro for MS-DOS 2.5
- Microsoft FoxPro for MS-DOS 2.5a
This article was previously published under Q98754 SYMPTOMS
If a key that is assigned to an ON KEY LABEL procedure is pressed while
that same procedure is executing, an undesirable recursive condition will
be created. If this same key is accidentally held down, the typematic
function of MS-DOS (the rate at which MS-DOS repeats a character when you
hold down a key) may fill the keyboard buffer with as many as 31
keystrokes.
After attempting to DO the procedure as many times as possible, the program
will abort with the message "DO nesting too deep."
RESOLUTION
To work around this problem, turn off the key trap at the beginning of the
procedure, then set it back on again as the procedure is exited. The sample
program below demonstrates this workaround.
Modification Type: | Major | Last Reviewed: | 12/3/2003 |
---|
Keywords: | kbcode KB98754 |
---|
|