My.ADVISOR.com Sign-In
ID
Password

Member Center / Sign-Up
Go to Article
Advanced Search 

ADVISOR ANSWERS

Getting into the Debugger in Visual FoxPro

If you're trying to use the Debugger more, here are some tips on how to get familar with it.

By Tamar E. Granor


Q: I’m trying to use the Debugger more, but find it hard to know where to put SET STEP ON in my code to help me find problems. Is there a better way to stop code execution?

A: There are a number of better ways to get access to running code than SET STEP ON. (In fact, I can’t remember the last time I used SET STEP ON or its alter-ego, SUSPEND.) The key to stopping code so you can step through it is breakpoints. A breakpoint stops execution and lets you take a look at what’s going on.

Breakpoints come in two basic flavors, those based on where you are in the code and those based on the value of an expression. VFP lets you set both kinds, as well as a hybrid of the two, and provides several ways to set each.

The most obvious way to set breakpoints is by using the Breakpoints dialog (figure 1), available from both the VFP menu and the Debugger. The Type dropdown lets you choose the kind of breakpoint to create. There are four choices:

  • Break at location -- stop execution before running the specified line;
  • Break at location if expression is true -- stop execution before running the specified line, but only if the specified expression evaluates to True.
  • Break when expression is true -- stop execution at the end of the line in which the specified expression becomes True.
  • Break when expression changes --stop execution at the end of the line in which the value of the specified expression changes.


Figure 1: The Breakpoints dialog -- You can set breakpoints using this dialog; breakpoints you set in other windows show up here, as well.

Getting into the Debugger

No reader comments ... yet.

    What do YOU think about this topic? Share your advice and thoughts using this form.

    Your Name

    REQUIRED : PUBLIC

    Your E-Mail

    REQUIRED : PRIVATE

    Job, Company

    OPTIONAL : PUBLIC

    City, State, Country

    OPTIONAL : PUBLIC

    Your Web Site

    OPTIONAL : PUBLIC

    Your Comment

    Please help everyone by keeping your comments on-topic, using clean language, and not defaming or making personal attacks.


    Your e-mail address is required, but it will not be displayed to the public or given to anyone. See our Privacy Policy. Comments become visible after they pass our spam filter, and spammers and abusers are permanently blocked. Please report spam or abuse.

    Printer-friendly
    page layout

    Keyword Tags: FoxPro, Microsoft

    ADVISORAMA
    When you're over the hill, you pick up speed.
    -- Charles Schulz, Peanuts

    ARTICLE INFO

    DataBased Advisor

    Web Edition: 2007 Week 35, Doc #19190

    Print Edition: September 2007

    FREE ACCESS FREE ACCESS

    SUBSCRIPTION STATUS
    You are not signed-in. If you are a subscriber to this publication, sign-in above to access locked articles. To subscribe or renew go to www.AdvisorStore.com.

    Subscribe to DATABASED.ADVISOR.com

    Get it all -- every current and past ADVISOR tech/business publication, now all-in-one subscription, with new articles and a huge reference library packed with expert advice, how-to and downloads. Subscribe now to get it all.

    DataBased.Advisor.com

    Subscribe to FileMaker Advisor Magazine

    Read the advanced guide to creating custom business database solutions with FileMaker software. Subscribe now to gain access to all the archives and downloads.

    FileMaker.Advisor.com

    Subscribe to Advisor Basics of FileMaker Pro

    Learn the fundamentals of using FileMaker Pro software. Every issue gives you step-by-step instructions on creating the databases you need. Subscribe now!

    FileMaker.AdvisorBasics.com

    Showcase Your Smarts

    Submit your tips, techniques and advice and let Advisor promote your business and build your career. Show the world what you know!

    AdvisorTips.com

    Use of this or any other site, content, product or service of Advisor Media constitutes acceptance of Terms of Use.
    Portions copyright ©1983-2008 Advisor Media, Inc. All Rights Reserved.
    Reuse or reproduction of any portion or quantity of Advisor Media's copyrighted content, in any form, for any purpose, requires written permission.
    ADVISOR®, the ADVISOR logo, and other names and logos that incorporate ADVISOR are registered trademarks, trademarks or service marks of Advisor Media, Inc. in the United States and/or other countries.
    Other trademarks are used for identification, editorial or descriptive purposes and are the property of their owners.
    Hosted by Prominic.NET Website powered by
    LOTUS SOFTWARE
    granl81-02 posted 08/27/2007 modified 01/09/2009 03:39:03 AM ztdbms/ztdbms
    domino-144.advisor.com my.advisor.com 01/09/2009 03:04:35 PM