vb – debugging tools appendix d. why do we need debugging? every program has errors, and the...

11
VB – Debugging Tools Appendix D

Upload: franklin-james

Post on 03-Jan-2016

216 views

Category:

Documents


1 download

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

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

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

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

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

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

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

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

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

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

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

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