Microsoft KB Archive/32149

= &quot;Duplicate Definition&quot; in QB.EXE; &quot;Equals Missing&quot; in BC.EXE =

Article ID: 32149

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 4.0
 * Microsoft QuickBASIC 4.0b
 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b
 * Microsoft BASIC Professional Development System 7.0

-



This article was previously published under Q32149



SUMMARY
If a line of code in the QuickBasic editor begins with two occurrences of the same nonreserved word, the second word will be correctly flagged as a &quot;Duplicate definition&quot; when either the Start or Make EXE File command is chosen on the Run menu. If the same word is used as a variable elsewhere in the program, it will give a &quot;Duplicate definition&quot; error at that occurrence of the word.

To generate the &quot;Duplicate definition&quot; message, enter &quot;a a&quot; in the QuickBasic editor, then choose Start on the Run menu. Please note that the line &quot;a a&quot; generates a different message, &quot;Equal sign missing,&quot; when compiled with BC.EXE.

The &quot;Duplicate definition&quot; message occurs because the editor assumes the first &quot;a&quot; to be the name of a SUBprogram and the second &quot;a&quot; to be a parameter to be passed to the SUBprogram. Routines and variables must have different names.



MORE INFORMATION
The following code example produces a &quot;Duplicate definition&quot; error on the second &quot;a&quot;: a a The following code example produces a &quot;Duplicate definition&quot; error on the first line: a = 1 a a

Additional query words: QuickBas BasicCom

Keywords: KB32149

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.