Use the Debugger


[Page 619 (continued)]

(See Appendix D for more details.)

  1. Break a program at a specified line.

     

    1.

    Place the cursor on the desired line.

    2.

    Press F9. A red dot will appear to the left of the line on the gray bar to indicate that the line has been set as a breakpoint. Whenever the running program reaches the breakpoint, it will go into debug mode.

    Note: To remove this breakpoint, repeat Steps 1 and 2.

    or

     

    1.

    Click on the thick gray bar at a point to the left of the line. Click again to remove the breakpoint.

    or

     

    1.

    Place the cursor on the line, press the right mouse button, and click on "Run to Cursor." In this case, the line is not set as a breakpoint; however, execution will stop the first time the line is reached.


  2. [Page 620]
  3. Remove all breakpoints.

     

    1.

    Press Alt/D/D or Ctrl + Shift + F9.

  4. Run a program one statement at a time.

     

    1.

    Break the program at a specific line using a technique described in Item A of this section.

    2.

    Press the F8 key to execute each statement.

  5. Run the program one statement at a time, but execute each general procedure call without stepping through the statements in the procedure one at a time.

     

    1.

    Break the program at a specific line using a technique described in Item A of this section.

    2.

    Repeatedly press the Shift + F8 key to execute successive liines and each general procedure without stepping through each statement in the procedure.

  6. Continue execution of a program that has been suspended.

     

    1.

    Press F5.

  7. Set the next statement to be executed in the current procedure.

     

    1.

    Place the cursor anywhere in the desired statement.

    2.

    Right-click on the line, and select "Set next statement."

  8. Determine the value of an expression during debug mode.

     

    1.

    Press Ctrl + Alt + W, followed by 1.

    2.

    Type the expression into the Name list, and press Enter.

    or

     

    1.

    In debug mode, hover the cursor over the variable to have its value displayed.




An Introduction to Programming Using Visual Basic 2005
Introduction to Programming Using Visual Basic 2005, An (6th Edition)
ISBN: 0130306541
EAN: 2147483647
Year: 2006
Pages: 164

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