dc_inspectobject() - Object Inspector

This forum is for eXpress++ general support.
Post Reply
Message
Author
reganc
Posts: 257
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

dc_inspectobject() - Object Inspector

#1 Post by reganc »

I am using eXPress++ (c) Version 2.0 Build 262

I have a WTF that shows me an object. When inspecting the object I used to be able to double click any variable to see the value of it. At present, this does not do anything at all.

Did something change? Or is this only happening to me?
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dc_inspectobject() - Object Inspector

#2 Post by rdonnay »

I have not made any functional changes to DC_InspectObject() in a very long time, with the exception that I added the ability to embed it in another window, such as the array browser. See attachment.

I think what you recall about double-clicking the value, was the behavior of WTF.
If you double-click the value in the WTF window, it will always bring up a viewer to see the value.

If the value is an array, it calls DC_ArrayView().
If the value is an object, it calls DC_InspectObject().
If the value is a character, it is shown in a MLE window.
If the value if a date, it is shown in a popup calendar.
If the value is a numeric, it is shown in a popup calculator.

DC_InspectObject() behaves a little differently. It only brings up a viewer for arrays and objects.
I can make the change to have it work exactly like WTF, and probably should.
inspect.jpg
inspect.jpg (181.21 KiB) Viewed 11205 times
The eXpress train is coming - and it has more cars.

reganc
Posts: 257
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

Re: dc_inspectobject() - Object Inspector

#3 Post by reganc »

The object variable that I tried to look at was an array. But I could not see it. Even if I used:

WTF oSupStock:aVendor

The WTF did not show me anything. Even a double click on that WTF line would not work. Interestingly, the following did work:

WTF aclone(oSupStock:aVendor)

but that would get long winded if I had to view the contents of more than one array in the object.
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dc_inspectobject() - Object Inspector

#4 Post by rdonnay »

Interestingly, the following did work:

WTF aclone(oSupStock:aVendor)
AHA!!! That says a lot.

When you are using WTF to view an array, the browse window only contains a pointer to that array. This is also true for an object.

Therefore, if you double click the value, the contents of the array may have changed before you clicked.
Try this little test:

aDir := Directory()
WTF aDir
ASize(aDir,0)

If you click on aDir in the WTF window it will be an empty array.
When you used Aclone(), you created a new pointer to the original array so anything you do afterwards will not affect it.

If you can try to put a PAUSE in the WTF command so you can observer the array contents in real time.
The eXpress train is coming - and it has more cars.

reganc
Posts: 257
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

Re: dc_inspectobject() - Object Inspector

#5 Post by reganc »

rdonnay wrote:
Interestingly, the following did work:

WTF aclone(oSupStock:aVendor)
AHA!!! That says a lot.

When you are using WTF to view an array, the browse window only contains a pointer to that array. This is also true for an object.

Therefore, if you double click the value, the contents of the array may have changed before you clicked.
Try this little test:

aDir := Directory()
WTF aDir
ASize(aDir,0)

If you click on aDir in the WTF window it will be an empty array.
When you used Aclone(), you created a new pointer to the original array so anything you do afterwards will not affect it.

If you can try to put a PAUSE in the WTF command so you can observer the array contents in real time.
Ok, I get that. Makes sense.

I just don't understand why have I not noticed this before. With an array it's easy to overcome with aclone() but objects are a different kettle of fish.

Thanks.
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

Zdeno Bielik
Posts: 147
Joined: Thu Jan 28, 2010 9:24 am
Location: Nitra, Slovakia
Contact:

Re: dc_inspectobject() - Object Inspector

#6 Post by Zdeno Bielik »

Hi Roger,

When you used Aclone(), you created a new pointer to the original array so anything you do afterwards will not affect it.
If you can try to put a PAUSE in the WTF command so you can observer the array contents in real time.
this is exactly way how I use it, but when there are many or more „wtf ... pause“ comnands, it slows down debug proccess
so, if you could make change default behavior for showing debugged arrays to automatically convert it before showing with AClone() function,
it will be perfect

Zdeno

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dc_inspectobject() - Object Inspector

#7 Post by rdonnay »

if you could make change default behavior for showing debugged arrays to automatically convert it before showing with AClone() function, it will be perfect
I would not want to do this automatically.
It would consume a lot of memory when observing large arrays.
I prefer that the programmer decide whether or not to use AClone.
The eXpress train is coming - and it has more cars.

Post Reply