Microsoft KB Archive/71792

= &quot;File Not Found&quot; OPENing Filename with Leading Spaces =

Article ID: 71792

Article Last Modified on 11/21/2006



This article was previously published under Q71792



SYMPTOMS
When you attempt an OPEN statement that specifies a filename with a leading space, a &quot;File Not Found&quot; error incorrectly displays (even if the file is opened FOR OUTPUT). The correct error message should be &quot;Bad File Name.&quot;



STATUS
Microsoft has confirmed this to be a bug in Microsoft QuickBasic versions 3.00, 4.00, and 4.50; with Microsoft Basic Compiler versions 6.00 and 6.00b (buglist6.00 and buglist6.00b); and with Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 (buglist7.00 and buglist7.10). We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

The workaround is to strip leading blanks from the filename used in the OPEN statement.



MORE INFORMATION
When the following program is run (either in the QB.EXE or QBX.EXE environment or when compiled to an executable .EXE program), it generates a &quot;File Not Found&quot; error:

Code Sample
OPEN &quot; test.dat&quot; FOR OUTPUT AS #1

Additional query words: QuickBas BasicCom buglist3.00 buglist4.00 buglist4.00b buglist4.50

Keywords: KB71792

-

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

© Microsoft Corporation. All rights reserved.