Microsoft KB Archive/71110

= BSAVE Filename Fails to Default to .BAS with Far Strings =

Article ID: 71110

Article Last Modified on 11/21/2006



This article was previously published under Q71110



SYMPTOMS
By historical convention dating back to the BasicA and GW-Basic Interpreters, the BSAVE statement creates files with the default name-extension &quot;.BAS&quot; if you specify no name extension (and no period) in the filename.

In Microsoft Basic PDS version 7.00 or 7.10, the filename extension written by BSAVE fails to default to .BAS if you are using far strings (either in the QBX.EXE environment, which always uses far strings, or from a program compiled with BC /Fs).



STATUS
Microsoft has confirmed this to be a bug in Microsoft Basic Professional Development System versions 7.00 and 7.10 for MS-DOS and MS OS/2. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
NOTE: Although it is a convention, the default .BAS extension for files created by BSAVE can cause problems. If you specify a BSAVE filename that is the same as the base name of one of your Basic source files, you may unintentionally overwrite your source file. For example, if you have a Basic source file named &quot;X.BAS&quot;, and you run the program below in the same directory, then the BSAVE file &quot;X&quot; with the default extension .BAS will overwrite your source file &quot;X.BAS&quot;. Therefore, Microsoft strongly suggests that you specify an extension (but not .BAS) for all BSAVE files. If you want a BSAVE file without a name extension, you can use a period (.) alone as the file extension (such as BSAVE X.), which prevents Basic from appending the default .BAS extension.

Code Example
DIM x%(100) DEF SEG = VARSEG(x%(0)) BSAVE &quot;X&quot;, VARPTR(x%(0)), 200 END When using Microsoft Basic PDS 7.00 or 7.10 with far strings (using QBX.EXE, or BC /Fs), this program will save the array x% in a file named X, violating the historical Basic convention. If you compile to use near strings (BC with no /Fs), or run or compile with earlier versions of Microsoft Basic, the filename will be X.BAS.

Additional query words: BasicCom SR# S910226-80 buglist7.00 buglist7.10

Keywords: KB71110

-

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

© Microsoft Corporation. All rights reserved.