Form Debugging Tips

Last reviewed: April 30, 1996
Article ID: Q129425
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0

SUMMARY

This article gives you tips that can be used with the Debug window to help you debug forms.

MORE INFORMATION

THIS and THISFORM Keywords

The THIS and THISFORM keywords can only be used in a class definition. Because an object has been instantiated when a form is running, the THIS and THISFORM keywords only reference the form object when a method is executing. You can use the form's name to reference it in the Debug window. A generic way to refer to the active form is to place the following expression on the left side of the Debug window:

   _SCREEN.ACTIVEFORM

The "(object)" word that is presented on the right side of the Debug window will signify that an object reference to the form exists.

How to Verify the Method Currently Executing

To verify the method currently executing, type PROGRAM() in the Debug window. For example, if you have defined code for the Load event, the right side of the Debug window will read FORM1.LOAD when the Load event is executed.

How to Verify the Name of the Active Control in a Form

To verify the name of the active control in a form, type:

     _SCREEN.ACTIVEFORM.ACTIVECONTROL.NAME

This expression returns the name of the member object, such as Command1.

How to Verify the Name of the Container of an Active Control

To verify the name of the container of an active control, type:

   _SCREEN.ACTIVEFORM.ACTIVECONTROL.PARENT.NAME

How to Suspend Execution of the Form

You can suspend execution of the form by setting a breakpoint in the Debug window. For example, to verify the order in which methods are executed when you run a form, you can place PROGRAM() on the left side of the Debug window. This function is updated each time a method or the code associated with an event is executed. If you set a breakpoint in the Debug window by clicking the center bar, the execution of the form will be suspended each time the value returned by PROGRAM() is modified.

REFERENCES

For more information about using the Debug window, search for the "Debug Window" topic in the FoxPro Help menu.


Additional reference words: 3.00 VFoxWin trace error current break point
breakpoint suspending
KBCategory: kbtool kbprg kbtshoot
KBSubcategory: FxtoolDebug


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 30, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.