Q34015: GOTO a Labeled ELSE Fails in QB.EXE 4.00 and 4.00b Editor
Article: Q34015
Product(s): See article
Version(s): 4.00 4.00b
Operating System(s): MS-DOS
Keyword(s): ENDUSER | buglist4.00 buglist4.00b fixlist4.50 | mspl13_basic
Last Modified: 4-DEC-1988
A QuickBASIC .EXE program compiled with BC.EXE Versions 4.00 or 4.00b
allows a jump to a labeled ELSE statement in an IF...END IF block.
However, in the QB.EXE Version 4.00 or 4.00b environment, control
falls through to the END IF.
To work around this problem, do not use a labeled ELSE.
Microsoft has confirmed this to be a problem in Versions 4.00 and
4.00b. This problem has been corrected in QuickBASIC Version 4.50.
Note: in QB.EXE and QB87.EXE from QuickBASIC Version 3.00, the
statements after the ELSE are correctly executed.
The following code example demonstrates the problem:
IF x = 0 THEN
PRINT "this is before else"
GOTO 100
100 ELSE
PRINT " this is after else"
END IF
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
Copyright Microsoft Corporation 1986-2002.