Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to manage entries in the watch window

Debugging and Tuning

How to manage entries in the watch window

by  Mike Lewis  Posted    (Edited  )
The watch window is an extremely useful tool, but it often gets very cluttered. There is no obvious way of clearing out the entries and starting with a clean slate - other than to laboriously select each item in turn and hit the Del key. Nor can you easily sort the items alphabetically. The only obvious way of doing that is to delete individual items and re-enter them in the desired order.

Fortunately, there are a couple of tricks that will help you manage your watch window entries.

The resource file

The entries are held in the Foxuser resource file, in a record whose ID is WATCHEXPR. Within that record, the entries can be found in a memo field called Data. However, if you want to delete the entries, donÆt simply delete the contents of the memo field. If you do, youÆll get an error message the next time you open the debugger.

You can, however, safely delete the entire record. This will clear out all the watch window entries, and might also reset your debugger window layout, although other debugger settings, like breakpoints, will remain intact.

The debugger configuration file

A better approach is to use a debugger configuration file. This is the file that is created when you select Save Configuration from the debuggerÆs File menu. It contains various debugger settings, including the watch window entries.

Now, the configuration file (which has the extension DBG) is an ordinary text file. You can open it in a text editor and edit the entries to suit your needs. The watch window entries begin with WATCH=, as in this example:

WATCH=alias()
WATCH=reccount()
WATCH=_screen.activeform

So you can manually add and delete entries, or arrange them in whatever order you like. The next time you go into the debugger, select Load Configuration from the File menu to restore the saved settings.

A good way of using this technique is to create a standard DBG file with a core set of your favourite watch window entries. During a debugging session, add more entries to the window in the usual way. From time to time, re-load the DBG to restore your favourites. The process only takes a couple of clicks but will make your use of watch window that little bit easier.

Mike Lewis
Edinburgh, Scotland
www.ml-consult.co.uk
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top