Microsoft KB Archive/120191

{| = FIX: Variable Not Created by ON KEY or ON ERROR =
 * width="100%"|

ID: Q120191

2.5x 2.60 | 2.5x 2.60 | 2.5x

MS-DOS   | WINDOWS   | MACINTOSH kbprg kbbuglist kbfixlist The information in this article applies to:


 * Microsoft FoxPro for MS-DOS, versions 2.5x, 2.6
 * Microsoft FoxPro for Windows, versions 2.5x, 2.6
 * Microsoft FoxPro for Macintosh, versions 2.5x

SYMPTOMS
The ON ERROR and ON KEY LABEL commands will not create a variable.

STATUS
Microsoft has confirmed this to be a problem in FoxPro versions 2.5x and 2.6 for MS-DOS, FoxPro versions 2.5x and 2.6 for Windows, and FoxPro versions 2.5x for Macintosh. This problem was corrected in FoxPro version 2.6a for MS-DOS, Windows, and Macintosh.

Steps to Reproduce Problem
Type the following commands in the Command window:

CLEAR ALL ON ERROR x=MESSAGE zzzzzzz  && this is supposed to invoke the ON ERROR routine ON ERROR && turns off the ON ERROR routine ?x       && this should result in "Variable 'x' not found"

CLEAR ALL ON KEY LABEL F2 x=1 * Press the F2 key ? x      && this should result in "Variable 'x' not found" Additional reference words: FoxMac FoxDos FoxWin 2.50 2.50a 2.50b 2.50c 2.60 2.60a buglist2.50 buglist2.50a buglist2.50b buglist2.50c buglist2.60 fixlist2.60a KBCategory: kbprg kbfixlist kbbuglist KBSubcategory: FxprgGeneral Solution Type : kbfix
 * }