Previous  Home  Next

Code windows

Here's the overall VB IDE screen again so you can orient yourself:

screenshot of Visual Basic editor

And here's a closeup of the Code Window:

You can see the code in each module in a separate window.

Doubleclick the name of the module in the Project Explorer window to open and view the module in the code window.

Good Programming Practice

You can have more than one module in a project. It's a good idea to group related subroutines and functions into individual modules. You might have one module for code that deals with files, another for code that performs string handling, etc.

For one thing, it makes it easier to find a specific bit of code quickly. And you can export modules from one project and import them into others; that makes it convenient to keep "libraries" of common code that all your projects can share.

You can click in a subroutine and press F5 to run it.

You can set a "break point" by clicking in the gray area just to the left of the line of code you want to break at. This causes code execution to stop at that point (just before executing the line) so you can examine the value of variables or step through manually from that point onward (using F8)

Previous  Home  Next