Discussions related to Visual Prolog
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Debugging Objects

Unread post by Harrison Pratt »

I suppose these are documented somewhere, but I can't find them:

How can I trace clauses in objects dynamically created from a class in the debugger?

Is it possible to view database facts in a dynamically created object in the debugger?
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Re: Debugging Objects

Unread post by Thomas Linder Puls »

Harrison Pratt wrote:How can I trace clauses in objects dynamically created from a class in the debugger?
I am not sure I fully understand the question. You can set breakpoints, single step in any such code.
Harrison Pratt wrote:Is it possible to view database facts in a dynamically created object in the debugger?
When you expand an object in the debugger (in the variables window) you will see its facts. For example you can expand the "This" variable when inside an object clause.

But you will need to have access to the object that you wish to inspect. If there are particular objects that you want to keep track of you can add it to the watch window (i.e. right click it in the variables window).

Also notice that there is no way to gain access to all the objects of a certain class (unless your program for example saves them in a fact database).
Regards Thomas Linder Puls
PDC
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Unread post by Harrison Pratt »

Thomas,
Forgive my vague question which made it hard for you to give a crisp answer. I expected the debugger to require pre-selection of facts and variables for display separately as it does in conventional code, not realizing than an object is just a more elaborate kind of variable.
That is great -- expanding the object view in the debugger gives both class and object information!
Thanks for your help,
Harrison

P.S. The actual data displayed in the images below won't make sense relative to the code in the test/0 clause because I loaded a nonsense file for privacy reasons.
Attachments
Snap_2016.09.30 14.43.25_001.png
Snap_2016.09.30 14.43.25_001.png (119.97 KiB) Viewed 6321 times
Post Reply