FIX: Variable Not Created by ON KEY or ON ERROR

Last reviewed: October 20, 1997
Article 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.

MORE INFORMATION

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


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: October 20, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.