Arrays Declared Twice in COMMON, Do Not Give Error in QB.EXE (44493)






This article was previously published under Q44493

SYMPTOMS

If an array is declared twice in a COMMON or a COMMON SHARED statement, it does not give you an error while running in the QuickBasic environment. The error is correctly flagged at compile time with a "duplicate definition" error.

STATUS

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

Code Examples

The following examples reproduce the problem:
 'example 1
   COMMON SHARED A$(),A$()

   'example 2
   COMMON SHARED A$()
   COMMON SHARED A$()

   'example 3
   DIM A(200) AS DOUBLE
   COMMON SHARED A() AS DOUBLE, B$, C$, A() AS DOUBLE

   'example 4
   COMMON SHARED A%(),
   COMMON SHARED B#,C#,A%()
				

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