Microsoft KB Archive/49130

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Knowledge Base

Article ID: 49130

Article Last Modified on 8/16/2005


  • 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


The QB.EXE editor in QuickBasic Versions 4.00, 4.00b, and 4.50 flags the error "SELECT without END SELECT." 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 "home" of the current window, even though the error may have occurred several pages down.


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).


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 "SELECT without END SELECT," 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 "SELECT without END SELECT" error
REM     occurs, no matter where the SELECT error is located in
REM     this window.
   ' 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 "IF" for the following
REM  "Block IF Without END IF" error:
   PRINT "hello"
      ' 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