vb – debugging tools appendix d. why do we need debugging? every program has errors, and the...
TRANSCRIPT
![Page 1: 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](https://reader036.vdocuments.site/reader036/viewer/2022082611/56649efc5503460f94c10374/html5/thumbnails/1.jpg)
VB – Debugging Tools
Appendix D
![Page 2: 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](https://reader036.vdocuments.site/reader036/viewer/2022082611/56649efc5503460f94c10374/html5/thumbnails/2.jpg)
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
![Page 3: 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](https://reader036.vdocuments.site/reader036/viewer/2022082611/56649efc5503460f94c10374/html5/thumbnails/3.jpg)
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?
![Page 4: 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](https://reader036.vdocuments.site/reader036/viewer/2022082611/56649efc5503460f94c10374/html5/thumbnails/4.jpg)
Syntax Errors
• How do they show up?????
![Page 5: 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](https://reader036.vdocuments.site/reader036/viewer/2022082611/56649efc5503460f94c10374/html5/thumbnails/5.jpg)
Run Time Errors
• How about them???
![Page 6: 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](https://reader036.vdocuments.site/reader036/viewer/2022082611/56649efc5503460f94c10374/html5/thumbnails/6.jpg)
Logic Errors
• Well???
• I’m waiting
• Maybe a good start is to find out what they really are
![Page 7: 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](https://reader036.vdocuments.site/reader036/viewer/2022082611/56649efc5503460f94c10374/html5/thumbnails/7.jpg)
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
![Page 8: 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](https://reader036.vdocuments.site/reader036/viewer/2022082611/56649efc5503460f94c10374/html5/thumbnails/8.jpg)
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.
![Page 9: 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](https://reader036.vdocuments.site/reader036/viewer/2022082611/56649efc5503460f94c10374/html5/thumbnails/9.jpg)
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
![Page 10: 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](https://reader036.vdocuments.site/reader036/viewer/2022082611/56649efc5503460f94c10374/html5/thumbnails/10.jpg)
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
![Page 11: 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](https://reader036.vdocuments.site/reader036/viewer/2022082611/56649efc5503460f94c10374/html5/thumbnails/11.jpg)
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