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



The information in this article applies to:

  • Microsoft Visual Basic Standard Edition for Windows 2.0
  • Microsoft Visual Basic Standard Edition for Windows 3.0
  • Microsoft Visual Basic Professional Edition for Windows 2.0
  • Microsoft Visual Basic Professional Edition for Windows 3.0
  • Microsoft Visual Basic Standard Edition for Windows 1.0

This article was previously published under Q76561

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.

Modification Type:MajorLast Reviewed:12/12/2003
Keywords:kbprb KB76561