KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q39185: BC.EXE "Variable Name Not Unique" Using Period in Identifier

Article: Q39185
Product(s): See article
Version(s): 4.00 4.00b 4.50
Operating System(s): MS-DOS
Keyword(s): ENDUSER | buglist4.00 buglist4.00b buglist4.50 SR# S881130-29 ptm214 | mspl13_basic
Last Modified: 26-FEB-1990

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

Microsoft has confirmed this to be a problem with 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.

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.

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

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.