Microsoft KB Archive/166936

= PRB: Letters A through J and M Invalid Object Variable Names =

Article ID: 166936

Article Last Modified on 5/10/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition
 * Microsoft Visual FoxPro 3.0b for Macintosh

-



This article was previously published under Q166936



SYMPTOMS
The following error occurs when trying to access the properties of an object that is named by a single character from A through J, or M:

Variable ' ' not found.



CAUSE
The letters A through J are reserved by Visual FoxPro to reference workspace names. The letter M is reserved for backward compatibility with the SCATTER and GATHER commands.



RESOLUTION
Do not name object variables by the single characters from A through J or M.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 Create a form. Place a command button on the form.  In the Click event of the command button, place the following code: C=THISFORM WAIT WINDOW C.NAME When this code is run, it produces this error:

Variable 'NAME' Not Found



If you need to use one of these letters as an object variable, use the following method to return the value of a property. This does not allow the setting of properties, nor does it expose any methods of the object. C="THISFORM" WAIT WINDOW EVALUATE(C+".NAME")

Keywords: kbprogramming kbprb KB166936

-

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

© Microsoft Corporation. All rights reserved.