Welcome to MSDN Blogs Sign in | Join | Help

Programmatically add a watch expression to the debug watch window

A user may want to add a particular variable or expression to the Visual Foxpro debug watch window

 

Here’s some code to do it.

 

The debugger can read/write a particular debug config file. The default is stored in the fox resource file. Or you can choose File->Save Configuration to save various configurations.

 

Try saving a config file and examining it to see the various options available.

 

This code assumes that you already have a FOXUSER record for WATCHEXPR.

 

 

 

TEXT TO myvar

DBGCFGVERSION=4

WATCH=_vfp.Caption

WATCH=myvar

BPMESSAGE=ON

EVENTWINDOW=ON

EVENTFILE=

ENDTEXT

 

USE SET("Resource",1) AGAIN SHARED

LOCATE FOR id="WATCHEXPR" AND !DELETED()

REPLACE data WITH CHR(4)+CHR(0)+myvar,ckval WITH VAL(SYS(2007,myvar))

USE

ACTIVATE WINDOW watch

 

43646

Published Friday, November 19, 2004 10:15 PM by Calvin_Hsia
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Programmatically add a watch expression to the debug watch window

Monday, June 12, 2006 3:20 PM by Gregory Green
Can this be extended to include programmically adding breakpoints?  I have tried to add to the resource table and it seems that the breakpoints are not be refreshed (reread from the table).  Thank you.

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker