KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q34280: QB "String Space Corrupt" Using a CONST in a FIELD Statement

Article: Q34280
Product(s): See article
Version(s): 4.00 4.00b
Operating System(s): MS-DOS
Keyword(s): ENDUSER | buglist4.00 buglist4.00b fixlist4.50 B_BasicCom | mspl13_basic
Last Modified: 12-DEC-1989

If a CONST constant is used as a variable in a FIELD statement and the
program is run more than once in the QuickBASIC Environment (QB.EXE),
a "String Space Corrupt" error will be generated.

BC.EXE correctly flags this programming error at compile time with the
message "Variable required."

Microsoft has confirmed this to be a problem in the QB.EXE in
Microsoft QuickBASIC Versions 4.00 and 4.00b, and in the version of
QuickBASIC shipped with the Microsoft BASIC Compiler Versions 6.00 and
6.00b for MS OS/2 and MS-DOS (buglist6.00 and buglist6.00b). This
problem was corrected in QuickBASIC Version 4.50 and in the QBX.EXE
environment of the Microsoft BASIC PDS Version 7.00 (fixlist7.00).

To duplicate the problem, run the following sample program twice in
the QuickBASIC Environment (QB.EXE):

   const x="x"
   open "test" as #1
   field #1, 10 as x$

If this program is compiled with BC.EXE, the compiler correctly flags
the programming error as follows:

Microsoft (R) QuickBASIC Compiler Version 4.00b
Copyright (C) Microsoft Corp. 1982-1988. All rights reserved.
 0030   0006    field #1, 10 as x$
                                ^ Variable required

43059 Bytes Available
42804 Bytes Free

    0 Warning Error(s)
    1 Severe  Error(s)

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.