Microsoft KB Archive/156033

= PRB: Unable to Reference SCX with Spaces in Filename =

Article ID: 156033

Article Last Modified on 12/1/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 6.0 Professional Edition

-



This article was previously published under Q156033



SYMPTOMS
If a form contains spaces in its file name, you may be unable to reference the form object created when this form is run either from program code or in the Debug or Watch window.



RESOLUTION
Successfully referencing form objects by SCX name requires replacing any space character(s) with underscores.



STATUS
This behavior is by design.



MORE INFORMATION
When a form is created by the DO FORM command, Visual FoxPro attempts to use the filename, minus the .SCX extension, as a variable to store the object reference for the form. If the filename contains spaces, Visual FoxPro determines that it is not a valid variable name and transforms it into something valid by replacing the spaces with underscores.

Steps to Reproduce Behavior
  Create a form by entering the following in the Command window: MODI FORM "X X"                        From the File menu, choose Save, and then close the Form Designer.  Run the form by entering the following in the Command window: DO FORM "X X"                         In Visual FoxPro 3.0 or 3.0b, open the Debug window and type X X in the left-hand side. In Visual FoxPro 5.0, open the Visual FoxPro Debugger and type X X in the Watch window.

Following this behavior, note that:


 * You will not see (Object) next to the X X in the Debug or Watch window.
 * If the X X is replaced with X_X, the form object can be correctly referenced.

Additional query words: kbdse VFoxWin

Keywords: KB156033

-

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

© Microsoft Corporation. All rights reserved.