eHow launches Android app: Get the best of eHow on the go.

How To

How to Check Visual Basic

Contributor
By Robert Karr
eHow Contributing Writer
(0 Ratings)

Programmers call "checking" Visual Basic debugging. This involves meticulously working through each line of code to track down errors. By paying sufficient attention to error trapping operations --- that is, routines the programmer includes in the code to identify and try to deal with bugs during development of the software --- debugging will be easier. Even so, with any complicated program, it is very difficult to anticipate what a multitude of users will do. Therefore, a check or debugging of every Visual Basic program is essential.

Difficulty: Moderate
Instructions

Things You'll Need:

  • Visual Basic 6.0 or Visual Basic Express
  1. Step 1

    Open the project you want to check with the Visual Basic program by clicking on "File" and then on "Open Project." Choose "Existing" and locate the file on your computer. The project should have an extension of .vbp for Visual Basic 6.0 or .vbproj for Visual Basic Express.

  2. Step 2

    Click on "View" followed by "Locals Window." Press "F8" to begin the debugging process.

  3. Step 3

    Follow any commands that require keyboard or mouse input when they pop up as part of one of the forms in your project, such as those asking for input.

  4. Step 4

    Press "F8" again when the debugging returns to the code window on a line highlighted in yellow. Review the information in the Locals window to see if it matches the values and type of data that you entered or that is called for at that point. You can also move your cursor back over the preceding line to check a value.

  5. Step 5

    Continue using the "F8" key to step all the way through your program. Insert breakpoints by pressing "F9" where you suspect problems may occur.

  6. Step 6

    Insert the Visual Basic word "Stop" on a new line at a point in the code where you get an error message so that you can temporarily halt the application and review the data steps leading up to the error.

Tips & Warnings
  • If a bug causes the application to go into some sort of repetitive operation, thus freezing the program, pressing "Ctrl-Break" in Visual Basic often will abort the process. Inserting good documentation while writing the code by using remarks (lines of explanation prefaced by an apostrophe), for example "'Change the integer value to a string to display correctly" will help you understand the code when checking it. Visual Basic Express and Visual Basic.NET handle debugging somewhat differently. There is no "Locals" window. Errors appear in the form of "Exceptions" using error and watch lists.
  • Be very careful as you check or debug the program if API (Application Programming Interface) code is included because this directly affects the operating system.
Resources

Post a Comment

Post a Comment
  • Have you done this? Click here to let us know.
I Did This

Related Ads

Computers
Alexia Petrakos,

Meet Alexia Petrakos eHow's Computers Expert.

Get Free Computers Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy.   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.

eHow Computers
eHow_eHow Technology and Electronics