Microsoft KB Archive/71109

= BC.EXE &quot;Name of Subprogram Illegal&quot; Means Duplicate Definition =

Article ID: 71109

Article Last Modified on 11/21/2006



This article was previously published under Q71109



SUMMARY
The BC.EXE compiler mistakenly gives the error message &quot;Name of subprogram illegal&quot; when a program has a SUBprogram and FUNCTION with the same name. The error message is supposed to be &quot;Duplicate Definition&quot;.

This information applies to BC.EXE in Microsoft QuickBasic versions 4.00, 4.00b, and 4.50; in Microsoft Basic Compiler versions 6.00 and 6.00b; and in Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10.



MORE INFORMATION
The error message &quot;Name of Subroutine Illegal&quot; occurs when compiling with BC.EXE from outside the QB.EXE or QBX.EXE environment. Inside the QB.EXE or QBX.EXE environment, the correct error message &quot;Duplicate Definition&quot; is displayed.

QuickBasic and Basic require that functions and subprograms have different names. Note that the type identifier %, $, #, !, or & at the end of a function name is not considered part of the function name, but rather tells the compiler what variable type the function returns.

The following sample code demonstrates the incorrect error message: DECLARE FUNCTION Test% (a$) DECLARE SUB Test (b$) The BC.EXE compiler will give the error &quot;Name of subprogram illegal&quot; on the second occurrence of the name Test. To eliminate the error message (which is supposed to say &quot;Duplicate Definition&quot;), you must give your subroutines and functions unique names.

Additional query words: QuickBas BasicCom

Keywords: KB71109

-

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

© Microsoft Corporation. All rights reserved.