Microsoft KB Archive/49130

= &quot;SELECT Without END SELECT&quot; Flagged in Wrong Place by QB 4.00 =

Article ID: 49130

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft QuickBasic 4.0
 * Microsoft QuickBASIC 4.0b
 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft BASIC Professional Development System 7.0

-



This article was previously published under Q49130



SYMPTOMS
The QB.EXE editor in QuickBasic Versions 4.00, 4.00b, and 4.50 flags the error &quot;SELECT without END SELECT.&quot; However, the editor does not correctly locate and highlight the area of the code where the error occurs. The editor incorrectly places the cursor (or highlighting) at the top right corner or &quot;home&quot; of the current window, even though the error may have occurred several pages down.



STATUS
Microsoft has confirmed this to be a bug in QB.EXE in QuickBasic Versions 4.00, 4.00b, and 4.50 for MS-DOS. This problem was corrected in the QBX.EXE environment supplied with Microsoft Basic Professional Development System (PDS) Version 7.00 for MS-DOS and MS OS/2 (fixlist7.00).



MORE INFORMATION
Whenever a mismatch occurs with two paired statements, the editor should highlight the other member of the pair when it reports an error message. For example, if a program contains a multiple-line IF statement but fails to include the END IF statement, the editor should locate the error, highlight the IF keyword, and then display the error message in a dialog box. However, for the error &quot;SELECT without END SELECT,&quot; the editor incorrectly fails to highlight the SELECT statement that is missing a matching END SELECT phrase.

Code Example
The following code example demonstrates the problem: REM <-- The QB.EXE editor misleadingly highlights this topmost REM REM    statement when the &quot;SELECT without END SELECT&quot; error REM    occurs, no matter where the SELECT error is located in REM     this window. SELECT CASE x% CASE 1 CASE 2 ' END SELECT ' Adding this END SELECT corrects the syntax error. The error-flagging location problem does not occur for IF statements, as in the following example: REM QB.EXE correctly highlights &quot;IF&quot; for the following REM &quot;Block IF Without END IF&quot; error: IF x% THEN PRINT &quot;hello&quot; ' END IF ' Adding this END IF corrects the syntax error.

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

Keywords: KB49130

-

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

© Microsoft Corporation. All rights reserved.