Debugging


Visual Basic provides a rich set of tools for debugging an application. Using the development environment, you can stop the program at different lines of code and examine variables, change variable values, look at the call stack, and call routines to exercise different pieces of the application. You can step through the program, executing the code one statement at a time to see what it is doing. You can even make some modifications to the source code and let the program continue running.

Chapter 1 describes the development environment, including the tools you can use to debug an application such as breakpoints, watches, and the locals, autos, immediate, and call stack windows. See Chapter 1 for details.

In addition to setting breakpoints in the code, you can use the Stop statement to pause execution at a particular line. This can be particularly useful for detecting unexpected values during testing. For example, the following statement stops execution if the variable m_NumEmployees is less than 1 or greater than 100.

  If (m_NumEmployees < 1) Or (m_NumEmployees > 100) Then Stop 




Visual Basic 2005 with  .NET 3.0 Programmer's Reference
Visual Basic 2005 with .NET 3.0 Programmer's Reference
ISBN: 470137053
EAN: N/A
Year: 2007
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net