Introduction to Debugging

As we mentioned earlier, logic errors are problems with your program’s logic. They are often hard to track because the program doesn’t stop working, it just produces incorrect results. To help track down these bugs in your program, Visual Basic provides several tools:

  • Breakpoints allow you to have VB stop on a certain line of code. You can then trace the code forward from the breakpoint a line at a time.

  • The Immediate window provides a way to execute statements (such as changing a variable’s value or calling methods) while your program is in debug mode.

  • The Output window provides a way to dump debug information to the screen, such as variable values.

  • Watches provide a way to keep track of the values of objects or variables ...

Get Special Edition Using Microsoft® Visual Basic® .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.