Microsoft KB Archive/58498

From BetaArchive Wiki
Knowledge Base


No Error in QB Using Duplicate Parameter Name in DECLARE

Article ID: 58498

Article Last Modified on 11/21/2006

This article was previously published under Q58498

SYMPTOMS

The QuickBasic environment fails to give an error message for a DECLARE statement that has several parameters with the same name. But when compiled with BC.EXE, the same statement correctly causes the following severe errors:

Formal parameters not unique

Formal parameter specification illegal

STATUS

Microsoft has confirmed this to be a bug in the QB.EXE environment of Microsoft QuickBasic versions 4.00, 4.00b, and 4.50; in the QB.EXE environment of Microsoft Basic Compiler versions 6.00 and 6.00b (buglist6.00, buglist6.00b); and in the QBX.EXE (QuickBasic Extended) environment of Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 for MS-DOS (buglist7.00, buglist7.10). We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The following code example fails to produce an error inside the QuickBasic QB.EXE or QBX.EXE environment:

   DECLARE SUB test (a%, a%)   'This line should cause error
   CALL test(1, 2)
   END

   SUB test (a%, b%)
   PRINT a%, b%
   END SUB
                

When the above program is compiled with BC.EXE, the compiler correctly flags the DECLARE line as follows:

   DECLARE SUB test (a%, a%)   'This line should cause error
                         ^ Formal parameters not unique
                         ^ Formal parameter specification illegal
                


Additional query words: QuickBas BasicCom buglist4.00 buglist4.00b buglist4.50

Keywords: KB58498