VB Debugging Tools Appendix D Why do we
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 – F 8 – line by line • Step Over – Shift / F 8 – skip a procedure • Step Out – Ctrl / Shift / F 8 – execute remainder • These are handled manually with these key strokes, I use them all the time
Break. Points • • • Setting – F 9 Program will execute up to this point Removing – F 9 Clear All - Ctrl / Shift / F 9 Set next Stmt – Ctrl / F 9 Continue or Advance – F 5 Run to cursor – Ctrl / F 8
- Slides: 11