Dear Mentors
I frequently use the debugger breakpoint, evaluate etc, but I have not figured out how to use watchpoint or tracepoint.
How do you set up a list of points to watch?
Secondly, the DOC file saves that you can change the values of variables while running degug. Kindly explain how.
SIncere thanks
debugger watchpoints - how?
Moderator: Rathinagiri
Re: debugger watchpoints - how?
You can assign new value in this way
YourVariable:=NewValue
YourVariable:=NewValue
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: debugger watchpoints - how?
My best tracing points of watch tool is MsgDebug() functionbluebird wrote: ↑Tue Sep 19, 2017 3:59 pm Dear Mentors
I frequently use the debugger breakpoint, evaluate etc, but I have not figured out how to use watchpoint or tracepoint.
How do you set up a list of points to watch?
Secondly, the DOC file saves that you can change the values of variables while running degug. Kindly explain how.
SIncere thanks
Saving changed values of variables to a file (not .doc but .txt file) is something like this:
Before beginning of (for example) traversing records of data file(s)
SET ALTERNATE TO <my trace file>
SET ALTERNATE ON
inside of loop :
? <myVariable>
after loop:
SET ALTERNATE TO
SET ALTERNATE OFF
That is all for me
Happy HMG'ing
Last edited by esgici on Tue Oct 03, 2017 8:41 am, edited 1 time in total.
Viva INTERNATIONAL HMG
Re: debugger watchpoints - how?
Thanks for the reply Mr. Esqici
Still, i would like to know how to use the debug utility
Still, i would like to know how to use the debug utility
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: debugger watchpoints - how?
My sample test code: main.prg
in debug.hbp
Open IDE and open debug.hpb project.
Click on Debugger icon in IDE as shown below:
As the debugger is opened, you can see many options. Find Watch Point and click that icon as below:
In the watch expression textbox, enter the name of the variable you want to watch as the program runs. (for example I have added nVar1 public variable)
Now, adjust the watch monitor grid column sizes to show all the columns as shown in the figure below. You can see that as of now nVar1 is undefined and the value is NIL.
Now start the program execution in Animate mode as shown the figure below:
You can see that the nVar1 value is now changed to 0 (which is initialized in line no. 4 Now the program expects the user to click the button. Now click the button.
You can also see that when the counting is over, the value of nVar1 is changed to 1000.
I hope this explains how to use watchpoints in Debugger.
Let us thank Dr. Claudio for giving this wonderful tool!
Code: Select all
#include <hmg.ch>
Function Main
public nVar1 := 0
define window main at 0, 0 width 400 height 300 main
define button count
row 10
col 10
caption 'Click me!'
action clicked()
end button
end window
main.center
main.activate
Return
function clicked
for i := 1 to 100
next i
nVar1 := 1000
msginfo( 'Counting over' )
return nil
Code: Select all
main.prg
Click on Debugger icon in IDE as shown below:
As the debugger is opened, you can see many options. Find Watch Point and click that icon as below:
In the watch expression textbox, enter the name of the variable you want to watch as the program runs. (for example I have added nVar1 public variable)
Now, adjust the watch monitor grid column sizes to show all the columns as shown in the figure below. You can see that as of now nVar1 is undefined and the value is NIL.
Now start the program execution in Animate mode as shown the figure below:
You can see that the nVar1 value is now changed to 0 (which is initialized in line no. 4 Now the program expects the user to click the button. Now click the button.
You can also see that when the counting is over, the value of nVar1 is changed to 1000.
I hope this explains how to use watchpoints in Debugger.
Let us thank Dr. Claudio for giving this wonderful tool!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.