Microsoft KB Archive/36028

From BetaArchive Wiki
Knowledge Base


.EXE "String Space Corrupt" Actually Is "Duplicate Definition"

Article ID: 36028

Article Last Modified on 11/21/2006

This article was previously published under Q36028

SYMPTOMS

In the program below, the QuickBasic QB.EXE environment correctly gives a "Duplicate Definition" error message, but the BC.EXE command-line compiler does not give the error. This may cause run-time problems in the .EXE program, such as hanging or "string space corrupt" error messages.

STATUS

Microsoft has confirmed this to be a bug in QuickBasic Versions 4.00, 4.00b, and 4.50, and in Microsoft Basic Compiler Versions 6.00 and 6.00b for MS-DOS and MS OS/2 (buglist6.00, buglist6.00b). This problem was corrected in Microsoft Basic PDS Version 7.00 (fixlist7.00).

To work around this problem, you can run the program in the QB.EXE environment to check for errors that the BC.EXE compiler misses.

MORE INFORMATION

The problem occurs in the .EXE regardless of whether or not you compile with the BC /D (debug) option.

The following is a code example:

     DEFINT A-Z
     DECLARE SUB TestRoutine ()
     TYPE XDef
        Area AS STRING * 10
     END TYPE
     COMMON SHARED /XYZ/ X AS XDef
     X.Area = "1234567890"
     TestRoutine
     PRINT X.Area
     END

     SUB TestRoutine STATIC
     DIM X AS STRING        ' "Duplicate Definition" in QB.EXE editor.
     X = "abcdefghi"        ' "String Space Corrupt" error here in .EXE
     END SUB
                


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

Keywords: KB36028