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

ID: Q76561


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for Windows, versions 2.0, 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 query words: 2.00 3.00

Keywords :
Version : WINDOWS:1.0,2.0,3.0
Platform : WINDOWS
Issue type :


Last Reviewed: January 25, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.