110 likes | 247 Views
VB – Debugging Tools. Appendix D. Why do we need debugging?. Every program has errors, and the process of finding these errors is debugging Types of errors Syntax Errors Run Time Errors Logic Errors. Debugging and Modes. VB has three modes Design Run Break
E N D
VB – Debugging Tools Appendix D
Why do we need debugging? • Every program has errors, and the process of finding these errors is debugging • Types of errors • Syntax Errors • Run Time Errors • Logic Errors
Debugging and Modes • VB has three modes • Design • Run • Break • Syntax Errors show up during design mode • Run Time Errors show up during run mode and invoke break mode • When do Logic errors show up?
Syntax Errors • How do they show up?????
Run Time Errors • How about them???
Logic Errors • Well??? • I’m waiting • Maybe a good start is to find out what they really are
Visual Basic 6.0 Tools • Immediate Window – You can type a statement in the immediate window, press enter, and the stmt you typed is executed. • The Immediate window is used to find what the value of variables are when the programmer selects the break mode
Visual Basic 6.0 Tools p-2 • Watch Window – is used to monitor (watch) an expression or a break expression. • At any time, the watch window shows the current values of all watch and break expressions • We add expressions to the Watch Window by right-click on a variable in the code window and add to watch. We can also edit and delete expressions.
Visual Basic 6.0 Tools p-3 • Locals Window – displays the names, values, and types of all variables in the current procedure. • Values of variables can be altered at any time in this window • Properties of objects can be modified through this window as well
STEP • Step Through – F8 – line by line • Step Over – Shift / F8 – skip a procedure • Step Out – Ctrl / Shift / F8 – execute remainder • These are handled manually with these key strokes, I use them all the time
BreakPoints • Setting – F9 Program will execute up to this point • Removing – F9 • Clear All - Ctrl / Shift / F9 • Set next Stmt – Ctrl / F9 • Continue or Advance – F5 • Run to cursor – Ctrl / F8