CTRL+HOME Commits Current Line to VB Syntax Checking/Parsing

ID Number: Q76561

1.00

WINDOWS

Summary:

In the Visual Basic Code window, edit keys that move the cursor from

a line will commit that line to syntax checking (and code parsing)

by the Visual Basic editor. This is not a problem with Visual Basic,

but is by design.

Note that you can turn off syntax checking by choosing the Syntax

Checking command from the Code menu.

This information applies to Microsoft Visual Basic programming system

version 1.0 for Windows.

More Information:

Visual Basic checks each line of code as it is entered for syntax and

usage. This is a feature of the Visual Basic 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 Problem

--------------------------

1. Start Visual Basic.

2. Open the Global module.

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

The correct error message "Invalid outside Sub or Function" 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 of the line, and therefore checks the

line 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