cancel
Showing results for 
Search instead for 
Did you mean: 

How to find library name for user object

Former Member
0 Kudos

I have a PB window which has a userobject placed on it.  How can I find out the name of the library object that was placed on the window to create the user object control (which was given a different name when placed on the window).

tia

las

Accepted Solutions (0)

Answers (9)

Answers (9)

Former Member
0 Kudos

Go to script painter of the control to see direct ancestors. (The second from the top is half the answer to the original question) Close the object. Use the object browser to locate it. RMB -> Edit. Title tells you which library it lives in.(other half answer to the question)

nayf
Participant
0 Kudos

Not really a solution for a large, existing app, but ...
at a previous work place, we had a class header for each object. Like an event/function header, but added to the Instance Variables section of an object with the object name and brief description. Therefore each object had it's own name as a string inside of it, which would show up in a search.

I found this incredibly useful, and not only for searching for object references. Would definitely recommend this approach for a new application.
That probably won't help in your situation though, for that I agree with the other suggestions about using the object browser as a good way to find an object.

Former Member
0 Kudos

I use the Object Browser (Browser... under the Tools menu), user object tab, this sorts all user objects in the application alphabetically which prevents you from having to hunt for it.  From the object browser you can right-click and edit the object at which point the library name and path will be displayed in the window title.

Get the name from the "inherited from..." from the top of the properties pane if you don't know the name.

Former Member
0 Kudos

Hi Laurel;

  If you know the object class name you are looking for an need to know its PBL location (especially in an application that has dozens or 100+ PBLs - here is what I do:

1) Open the Object Browser from the PB IDE's main toolbar ...

2) Locate the object in the appropriate area of the Object Browser.

3) Use the RHMB and select the "Edit" option from the resulting popup menu.

4) When the object class opens in the appropriate browser - the MDI Sheet window title will tell you where its located (ie: PBL).

HTH

Regards ... Chris

Former Member
0 Kudos

Another way would be to use the Object Find feature from PB Tools:

https://myelkovan.codeplex.com/

Former Member
0 Kudos

Hi Laurel;

  In addition to Brad's great suggestion, here are a few other tools:

1) PBSearch:  Topwiz Software - PBSearch

2) PBLPeeper:  PBL Peeper   (free)

3) VisualExpert: Understand & modify any PowerBuilder application

HTH

Regards .. Chris

Former Member
0 Kudos

Hi It has always been a problem for me to find an object in the big project. I begged Sybase to develop something for this problem but they didn't. And I developed "Object Find" in PBTools. You can find any object by writing some letters of object names. After listing the object names, I would like to open the object by double clicking it, but no way, there is no PB API for that. Murat Yelkovan https://myelkovan.codeplex.com

Former Member
0 Kudos

In addition to Brad's reply, in the title of the Properties window, as his example, the u_cst_myobject is the actual PB object contained in one of your PB Libraries. You can then search for that object from your libraries.

Former Member
0 Kudos

Hi Neil;

  There is a bug in the PB IDE "Search" feature that does not locate an object in your PBL list when you search on a Target. This is the case in PB 12.6 and I can (and have) reported this issue since at least PB the 3/4 beta's.  

  For example:

In the above test, the object being searched for is indeed one of the PBL's in the Target's library list.

Regards .. Chris

Former Member
0 Kudos

Hi Chris,
I was able to see this issue in PowerBuilder 12.6 and have reported it to engineering under cr779392.

Thanks for bringing it to our attention.

Ted Zimmerman

Former Member
0 Kudos

Thanks Ted!   

WOW .. after almost two decades we might finally get this bug fixed.  Yeehaaaaaaw! 

Former Member
0 Kudos

If you select the userobject in your window, the properties pane will show you the object name of the userobject in the title.

e.g.

Properties - uo_1 inherited from u_cst_myobject

Former Member
0 Kudos

Edit the window source. At or near the beginning you'll see the forward declarations section (bracketed by "forward" & "end forward" lines). In this section are type declarations that should contain the information you are requesting.

For example, if the window contains a DataWindow control user object named dw_maint which is inherited from ancestor user object u_dw, you would see a type declaration that begins:

type dw_maint from u_dw within <windowclassname>


Former Member
0 Kudos

Hi Laurel;

  Are you asking about ...

1) Locating it in the PB IDE?

- or -

2) Locating this information at application run-time?

Regards ... Chris

Former Member
0 Kudos

If I understand you right you want to know where a user object control is inherited from. You can use the Classdefinition property of your control. The classdefinition object has a property called Ancestor of type Classdefiniton. Its Name property contains the name of the class:

e.g. uo_1.Classdefinition.Ancestor.Name

Former Member
0 Kudos

A little correction: Because the Classdefinition property of a control is of type powerobject you have to do a type cast:

Classdefinition lcd_control

lcd_control = uo_1.Classdefinition

MessageBox ("Ancestor Name", lcd_control.Ancestor.Name)