Wiki Home

VFP Debugout Window


Namespace: Wiki
A place to discuss the VFP Debug Output Window
You can activate the debug output window in the following ways:
  • Tools - Output Window from the main menu
  • In the Command Window, type ACTIVATE WINDOW "Debug Output"
    You use the debug output window with the DEBUGOUT command, like this
    DEBUGOUT "Hello world"
    DEBUGOUT DATE()
    DEBUGOUT 21/7
    DEBUGOUT 21/7, "Hello World", "new in VFP9"
    

    This prints the following in the Debug Output window:
    Hello world
    08/07/99
    3
    3 Hello World new in VFP9
    You can clear the debugout window: menu, window, clear output window. Or right-click on the debug output window and choose "Clear".
    Also: Clear Debug but that does more. I think it is the same as Window, Restore to Default.. From the help: 'Clear debug - Clears all breakpoints in the Debugger and restores the Debugger windows'
    According to the Hackers Guide
    DEBUGOUT is a much better choice than the WAIT WINDOWs we're all accustomed to using. By its very nature, WAIT can change the timing of activities in your code. The only thing DEBUGOUT does is take a tiny, tiny chunk of time to send the data you pass it along. Best of all, you don't even really have to pull DEBUGOUT statements out of your code. If the Debug Output window isn't available (either because itís closed or because you're running the runtime), the output just goes into the bit bucket.

    SET DEBUGOUT lets you send the output to a file as well as the Debug Output window. (Actually, if the debugger is closed, the redirected output goes only to a file.) Just specify a filename and VFP happily sends anything that's going to the Debug Output window to that file as well. Include ADDITIVE to continue an existing file. Issue SET DEBUGOUT TO with no filename to close the current output file.

    One warning here: VFP empties the specified file as soon as you issue SET DEBUGOUT, not the first time you put something in. So make sure you have the right filename before you press Enter.

    ....

    There's one other point worth noting. The Debug Output window actually receives more than just DEBUGOUT statements. Assertion messages and any events being tracked land there, too, and are placed in the specified file, as well.

    You can seed debugout program() statements into your method code for methods that are not events so that you can track them with the events in the output window.

    - I have to apologize for possibly being dense here...I do not understand the above paragraph, "You can seed debugout program() statements..." Can that be explained a little more? This paragraph I wrote can be deleted and the clarification can be put in its place. Thanks for the help.

    I just meant that you can put DEBUGOUT PROGRAM() in lots of methods and functions. Then, the Debug Output window will show you the order in which things are being executed.--TamarGranor
    The contents of the window can be copied and pasted into edit windows which allows you to side-by-side compare the results of a code change. This is particularly handy when you are trying to track a complicated sequence of events.
    Better yet, using SET DEBUGOUT TO you can write all debougout messages to a file, which you can compare to a previously saved file. Debugout window doesn't have to be open for the ligfile to fill.
    Next: TBA :)
    Contributors Steven Black David Frankenbach
    Category VFP Ide Category VFP Debugger Category Code Samples


    but it opens the debugger slowing down everything Peter
  • ( Topic last updated: 2013.12.24 03:27:35 PM )