Microsoft KB Archive/76561

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

Article ID: 76561

Article Last Modified on 12/12/2003

-

APPLIES TO


 * Microsoft Visual Basic 2.0 Standard Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 2.0 Professional Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 1.0 Standard Edition

-



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 &quot;Expected: Statement&quot; 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: kbprb KB76561

-

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

© Microsoft Corporation. All rights reserved.