Microsoft KB Archive/37319

= QB.EXE Editor Fails to Flag Extra ELSE Clause as Syntax Error =

Article ID: 37319

Article Last Modified on 11/21/2006



This article was previously published under Q37319



SYMPTOMS
In the program code example below, the QB.EXE environment fails to detect an extra ELSE clause in an IF statement as being a syntax error. Instead, the number 0 is displayed as well as number 2.

The BC.EXE compiler successfully flags the extra ELSE clause as a syntax error. It is logically illegal to use two or more ELSE clauses in an IF statement. Only one ELSE clause is allowed in an IF statement. (The ELSE clause can also be left out of an IF statement.)



STATUS
Microsoft has confirmed this to be a bug in QuickBasic Versions 4.00, 4.00b, and 4.50. This problem is corrected in the QBX.EXE environment that comes with Microsoft Basic PDS Version 7.00 (fixlist7.00).

The following is a code example: a = 0 IF a = 0 THEN PRINT a ELSE PRINT 1 ELSE PRINT 2 END IF

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

Keywords: KB37319

-

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

© Microsoft Corporation. All rights reserved.