Microsoft KB Archive/39185
Article ID: 39185
Article Last Modified on 11/21/2006
- Microsoft QuickBasic 4.0
- Microsoft QuickBASIC 4.0b
- Microsoft QuickBasic 4.5 for MS-DOS
This article was previously published under Q39185
The following program gives a "Variable Name Not Unique" error when you attempt to compile with BC.EXE or the Make .EXE File... option in QuickBasic Versions 4.00, 4.00b, and 4.50:
DIM cur.pos AS INTEGER DIM cur(1,1) AS INTEGER
The same program runs correctly within the QB.EXE editor environment.
To work around the problem, do not use a period (.) in a variable name except for an element in a user-defined type (defined with TYPE...END TYPE). Another workaround is to use DIM CUR%(1,1) (using the % type suffix) instead of DIM CUR(1,1) AS INTEGER.
Microsoft has confirmed this to be a bug in Microsoft QuickBasic Versions 4.00, 4.00b, and 4.50 for MS-DOS, and Microsoft Basic Compiler Versions 6.00 and 6.00b for MS-DOS and OS/2 (buglist6.00, buglist6.00b). The problem was corrected in Microsoft Basic Professional Development System (PDS) Version 7.00. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
The error appears in the BC.EXE compiler output listing as follows:
DIM cur.pos AS INTEGER DIM cur(1,1) AS INTEGER ^Variable Name Not Unique
Additional query words: QuickBas buglist4.00 buglist4.00b buglist4.50