.EXE "String Space Corrupt" Actually Is "Duplicate Definition" (36028)






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
				

Modification Type: Minor Last Reviewed: 1/8/2003
Keywords: KB36028