PRB: CTRL+HOME Commits Line to VB Syntax Checking & Parsing

Last reviewed: June 21, 1995
Article ID: Q76561
The information in this article applies to:
  • Standard and Professional Editions of Microsoft Visual Basic for Windows, versions 2.0 and 3.0
  • Microsoft Visual Basic programming system for Windows, version 1.0

SYMPTOMS

In the Visual Basic for Windows Code window, edit keys that move the cursor (insertion point) off a line will commit that line to syntax checking and code parsing by the Visual Basic for Windows editor. You can turn off syntax checking by choosing the Syntax Checking command from the Code menu.

STATUS

This behavior is by design.

MORE INFORMATION

Visual Basic for Windows checks each line of code as it is entered for syntax and usage. This is a feature of the Visual Basic for Windows editing environment that prevents entry errors. Syntax checking is done before performing any edit function in which the cursor will leave the current line. Thus, any edit key combination that moves the cursor from that line will initiate the checking process.

Steps to Reproduce Behavior

  1. Start Visual Basic.

  2. Open the Global module.

  3. Type "This is a test" and press CTRL+HOME.

An error message of "Expected: Statement" will be displayed. You may not expect the error to occur because the cursor has not yet left the line of code with the error; however, CTRL+HOME normally moves the cursor off the line, and therefore the line is checked before doing the edit operation, resulting in the error message.

Similar behavior results when using other edit keys that move the cursor from the current line, such as ENTER, PAGE UP, PAGE DOWN, CTRL+END, UP ARROW, DOWN ARROW, and so on.


Additional reference words: 1.00 2.00 3.00
KBCategory: kbenv kbprg kbprb
KBSubcategory: EnvtDes


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.

Last reviewed: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.