Microsoft KB Archive/197193

= FIX: Application Error in Locals Window with Specific Variables =

Article ID: 197193

Article Last Modified on 10/16/2002

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a

-



This article was previously published under Q197193



SYMPTOMS
When you do the following:


 * 1) Run a program that uses several variables consisting of single alpha character names.
 * 2) Release a form.
 * 3) Scroll the Debugger Locals window to look at some of the variable values.

Windows displays an application error message, and Visual FoxPro is terminated.

The message displayed depends on the operating system:

 Under Windows NT, an error message similar to the following appears:

An application error has occurred and an application error log is being generated.

vfp.exe

Exception: access violation (0xc0000005), Address 0x0043e8db

 Under Windows 9x, an error message similar to the following appears:

This program has performed an illegal operation and will be shut down. If the problem persists, contact the program vendor.

If you click Details in the dialog box, a message similar to the following appears:

VFP caused an invalid page fault in module VFP.EXE at 0137:0044940e.





STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been corrected in Visual FoxPro 6.0.



Steps to Reproduce Behavior
  Run the following code from a program (.prg) file: SET STEP ON     CLEAR DEBUGGER STORE .t. to a,b,c,d,e,f,g,h KEYBOARD "{enter}"

TheForm=CreateObject("aForm") TheForm.show READ events RETURN

DEFINE class aForm as form ADD object aButton as commandbutton PROCEDURE aButton.click thisform.release ENDPROC ENDDEFINE  Switch to the debugger by pressing ALT+Tab. Scroll down in the Locals Window to the last item by clicking on the down arrow in the Locals Window scroll bar.</li> The Locals window scroll bar must be visible for this behavior to occur. If you do not see the error, you can make the Locals window shorter by resizing it with the mouse, and repeating the steps.</li></ol>

RESULT: You will receive an application error that will vary depending on the operating system. See the SYMPTOMS section above for details. The addresses may vary depending on operating system version or Visual FoxPro 5 build number.

This only happens with these specific variable names. If you modify the STORE command in the program above to read as follows, the behavior does not occur: STORE .t. to aa,bb,cc,dd,ee,ff,gg,hh As a rule, it is a good idea to avoid the letters "A" through "N", uppercase or lowercase, for variable, field, or table names. Visual FoxPro uses these as default alias names for tables when tables are opened and their names are already in use.

Example: USE table1 USE table1 AGAIN IN 0 The second table1 will be used under the alias A.

This error does not occur if you do not scroll in the Locals window.

(c) Microsoft Corporation 1998, All Rights Reserved. Contributions by Jim Saunders, Microsoft Corporation

Keywords: kbbug kbfix kbvfp600fix kbmisctools kbxbase KB197193

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.