"Wrong Number of Dimensions" on DIM or COMMON with Array (80564)






This article was previously published under Q80564

SYMPTOMS

When you specify an array in a COMMON statement and later use the array with the wrong number of dimensions, the QB.EXE and QBX.EXE environments correctly report "Wrong number of dimensions," but incorrectly indicate the position of the error as being in either the COMMON statement or the DIM statement for the array.

STATUS

Microsoft has confirmed this to be a bug in the QB.EXE environment of Microsoft QuickBasic versions 4.0, 4.0b, and 4.5, and in the QBX.EXE environment of Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

To find the true position of the error in this case, use the BC.EXE compiler to compile your source file and generate a compiler listing, from the MS-DOS command prompt. For example:

BC test.bas,,test.lst; /A

The .LST compiler listing will indicate the line that has the error.

The following code example demonstrates the problem:
   COMMON a()
   DIM a(9, 9)
   a(1) = 1
				

Modification Type: Minor Last Reviewed: 1/9/2003
Keywords: KB80564