Debugging

I 'm sure you all heard what a bug is (and if you don't, it's a program error). Bugs can really mess up your program. Even if you think "Oh my program has no bugs, I haven't found even one," well most bugs don't pop up until later on, when you least expect it. Debugging may not sound like much, but believe me, in the long run it is.

In order to find these bugs and correct them VB, has a debugger. The debugger searches for bugs so you can fix them. The debugger may not always be accurate, and may not always find all the bugs, but the more you find and fix the better your program is. And since rarely is any program bug-free, it's best to test it and debug often.

Kinds Of Bugs

Syntax Errors It's a misspelled command (example "If X = X thne" It's suppose to say "Then")
Runtime Errors Error when your program is run (example if you have a form w/ only a command button, and in the buttons code you write " Label1.Caption = "VB" " then, run it and you will see that's a runtime error)
Logic Errors An error based on bad logic

VB 's Debugging Tools

Step Into Steps into your code line by line excecuting that code, basically it shows you what the code does when it executes
Step Over Steps over your code (similar to step into)
Step Out Steps out, executes the remaining lines of a function where the execution is taking place

The Immediate window isn't any ordinary window, you type statements in it VB executes it & displays the output (what it does) during break mode.


Printing