BC.EXE "Syntax Error" Instead of CONST "Duplicate Definition" (30313)






This article was previously published under Q30313

SYMPTOMS

You will receive the message "Syntax Error" instead of "Duplicate Definition" if you use the same name for a CONST and a variable when using BC.EXE.

STATUS

Microsoft has confirmed this to be a bug in QuickBasic versions 4.00, 4.00b, and 4.50; in Microsoft Basic Compiler versions 6.00 and 6.00b for MS- DOS and MS OS/2; and in Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 for MS-DOS and MS OS/2. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

When the following sample program is run inside the QB.EXE or QBX.EXE editor, you receive the expected "Duplicate Definition" error on the CONST statement. The same line produces a "Syntax Error" message when compiled using BC.EXE.

QuickBasic version 3.00 produces the error message "Constant assignment illegal" when compiled inside the QB.EXE editor or from the DOS command line.

The following sample program demonstrates the inconsistent error message:
   'If this is compiled in the editor you get a "Duplicate Definition"
   'If this is compiled with BC.EXE you get a "Syntax Error"
   a = 5
   CONST a = 6
				

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