Wrong Number of Dimensions in Common or Dim Statement (95863)



The information in this article applies to:

  • Microsoft Visual Basic for MS-DOS
  • Microsoft Basic Professional Development System for MS-DOS 7.1
  • Microsoft QuickBASIC 4.5

This article was previously published under Q95863

SYMPTOMS

When you specify an array in a Common statement and later use the array with an incorrect number of dimensions, the QB.EXE and QBX.EXE environments correctly report "Wrong number of dimensions," but incorrectly indicates 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 products listed above. 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, use the BC.EXE compiler from the MS-DOS command prompt to compile your source file and generate a compiler listing. For example:

BC /A TEST.BAS,,TEST.LST

The .LST compiler listing indicates the line that has the error.

The following code sample reproduces the problem:
   Common a()
   Dim a(9, 9)
   a(1) = 1
				

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:KB95863