Microsoft KB Archive/25998

= &quot;Duplicate Definition&quot; with Same Name of SUBprogram, Variable =

Article ID: 25998

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft QuickBASIC 4.0b
 * Microsoft QuickBasic 4.0

-



This article was previously published under Q25998



SUMMARY
When you run the program below, a &quot;Duplicate definition&quot; occurs because a variable and SUBprogram have the same name, not counting the type of declaration suffix (i.e., !, #, $, &, or %).

You can work around this design limitation by changing the variable name or the subprogram name.

This information applies to QuickBasic Versions 4.00, 4.00b, and 4.50, and the Basic compiler Versions 6.00 and 6.00b.



MORE INFORMATION
The following program demonstrates the &quot;Duplicate Definition&quot; error: ' THIS IS THE MAIN PROGRAM: DECLARE SUB abc DEFINT A-Z abc! = 2 CALL abc

SUB abc STATIC PRINT &quot;hello&quot; END SUB

Additional query words: QuickBas BasicCom

Keywords: KB25998

-

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

© Microsoft Corporation. All rights reserved.