VBScript - Debugging
VBScript - Debugging
VB Script
• Error Handling
Error Handing is the programmer’s line of defense against this
inherent unpredictability.The term error handing refers not only to
how a program responds when an error occurs, but also to how it
prevents errors from happening in the first place.
• Debugging
Debugging, as the name suggests, is the process of detecting,
locating, and removing bugs from a program.
Debugging
What is Debugger?
A debugger is a tool to help programmers follow the logic of their
code as it runs. This can aid not only in finding bugs, but also in
simply understanding a program.
Example: If the problem you are having is deep down the code in your
function, you would mark a certain line in the function as a breakpoint.The
program would run up until the breakpoint is reached, at which point the
program pauses execution, showing you the breakpoint line.
Step Into , Step Over, and Step Out: A way to step through your code one
line at a time.
Debugging
Step Into will bring the debugger into a procedure or function, If one is being called
and if the code for it is in the scope of the debugger.This is useful when you suspect
the procedure being called might have a problem.
Step over:Will do the opposite: If the line you are on calls a procedure or function, the
debugger will execute it without stepping into it.This is useful when you are confident
that the procedure being called is not part of the problem you’re debugging.
Add Watch:A way to view the value of all of the variables active at any given point in
the code.While code execution is paused, mostly any debugger will have some way
to view all of the variables active at that point in the code and what their values
are.(Using Command Widow)
Call Stack:A way to view the “Call Stack” .The Call Stack is the nested sequence of
function and procedure calls that have led to a certain point in the code.Example: The
Call stack displayed the Main procedure which called the sub procedure and also sub
procedure calling to another low-level procedure.
Debugging without Debugger