| Subject |
Re: versatility of the Inspector |
| From |
Andy Taylor <andy.taylor.1959@outlook.com> |
| Date |
Mon, 26 Oct 2020 06:32:29 -0400 |
| Newsgroups |
dbase.getting-started |
Hi Gaetano,
I use it all the time, it's invaluable. I'm sure I've suggested it here from time to time, but maybe not.
I have it built into my standard application help menu - 3 options to open either _app, app (custom stuff separate from _app) or form.
This is great for testing programs and forms in development.
However, it cannot be used in an executable; so the help options noted above are removed if _app.runTimeType=1
Also, inspecting an object adds signifcantly to that object's refCount() value. So be careful when determining if an object that you have added any custom properties that refer to other objects (such as "this.parent =") can be safely released from memory by checking that refCount returns the same number as it did when the object was first instantiated. So don't use the inspector to check this. :-)
I admit this last point is obscure, but it's a reminder that you can't just add custom properties to your objects that refer to other objects and also expect dBASE to release them properly from memory automatically. You should remove all these properties before you release the object. If you don't and dBASE manages to keep running then strange and unexpected things may well start to happen.
Regards,
Andy
> Hi All,
>
> While looking at a Help entry recently I realized that the Inspector is
> not only available in the designers but also as a standalone command -
> inspect(<object>) - that can be used with any object even during program
> execution apparently.
>
> I had never heard anyone suggest to use Inspect(), it may be that
> everyone knows this and uses it or that it is one of the little known
> features of dBase.
>
> I have many time thought about how to get to know all the available
> properties or events of an object, especially after someone on the NG's
> told me about a property I had no idea existed, and this seems to be the
> answer to it.
>
> I tried it on the command line on the _app object and it returned an
> inspection window with a variety of info like the character set, iniFile
> location, currentUserPath...etc., including a custom property that I had
> just created to check if it would be listed.
>
> So is anyone using this regularly? and if so, in what context do you
> find it useful?
>
> Cheers,
> Gaetano.
>
>
>
|
|