Appendix D. Visual Basic Debugging Tools


[Page 627]

Errors in programs are called bugs, and the process of finding and correcting them is called debugging. Since the Visual Basic editor does not discover errors due to faulty logic, these errors present the most difficulties in debugging. One method of discovering a logical error is by desk-checking, that is, tracing the values of variables on paper by writing down their expected value after "mentally executing" each line in the program. Desk checking is rudimentary and highly impractical except for small programs.

Another method of debugging involves placing MsgBox statements at strategic points in the program and displaying the values of selected variables or expressions until the error is detected. After correcting the error, the MsgBox statements are removed. For many programming environments, desk checking and MsgBox statements are the only debugging methods available to the programmer.

The Visual Basic debugger offers an alternative to desk checking and MsgBox statements. It allows you to pause during the execution of your program in order to view and alter values of variables. These values can be accessed through the Immediate, Watch, and Locals windows, known as debugging windows.




An Introduction to Programming Using Visual Basic 2005
Introduction to Programming Using Visual Basic 2005, An (6th Edition)
ISBN: 0130306541
EAN: 2147483647
Year: 2006
Pages: 164

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net