1. Tracy Lamb
  2. PowerBuilder
  3. Tuesday, 8 March 2022 18:38 PM UTC

Hi all,

I've got a structure that I use all the time to pass variables from one window to another (usually a response window)... str_parms.  It's a bunch of empty arrays of different datatypes... string[], long[], date[], etc.  I am developing a new email window with a response and want to pass a few different variables, including a datawindow.  I don't think I've ever passed a datawindow before, so I wanted to know if one of the arrays in the structure is datawindow[] or PowerObject[] or something like that.  So I searched all my libraries for the structure definition but can't seem to find it anywhere! 

I'm using PB19 R3 Build 2728.  I'm also using the PFC libraries.  The libraries are VERY old, I've just been migrating them with each new PB version.

~~~Tracy

 

Accepted Answer
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 9 March 2022 21:55 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi,

If your structure is an object somewhere in a library, (and not defined at window or object level inside an object itself), then you can simply use the ObjectBrowser in the IDE:

 

Locate the object on the left (select the first row and just start typing the name until you find it). In older powerbuilder versions you then right click on the object and choose Edit. In newer versions you can just double-click the object.

Once the object has been opened, you can see its path in the title.

regards

 

Comment
  1. Tracy Lamb
  2. Thursday, 10 March 2022 03:13 AM UTC
My goodness, this was very fast! I didn't even think about using the Browser, I've never used it before! Thank you so much!!!

~~~Tracy
  1. Helpful 1
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 8 March 2022 18:56 PM UTC
  2. PowerBuilder
  3. # 1

Hi, Tracy - 

I assume you have a LOT of pbl's to examine!

If you have a window that you can temporarily add a command button to, place the following script in its Clicked event (substitute the proper structure object name in the "FindClassDefinition" PowerScript function call, of course):

ClassDefinition lcd

lcd = FindClassDefinition("s_parms")
If IsValid(lcd) Then
   MessageBox("Found it!","It resides in: "+lcd.LibraryName)
Else
   MessageBox("Rats!","Can't find it.")
End If

This form of the FindClassDefinition function searches all of the libraries in the current target's library list. You can alternatively supply an optional list of libraries to be examined (refer to PB Help).

Regards, John

Comment
  1. Tracy Lamb
  2. Tuesday, 8 March 2022 19:27 PM UTC
Thanks you John! That worked perfectly! It's in a library I wouldn't suspect (I have 32 of them), but I thought I looked previously... It's in my uob pbl (user objects). I'm going to move it to the main pbl!
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 8 March 2022 19:30 PM UTC
  2. PowerBuilder
  3. # 2

Hi Tracy;

   Any standard object class pointer would of type "PowerObject" and then you would need to cast the ponter to use it. However, you could just use DataWindow (control) to "lock in" the type.

FWIW: In my STD framework I just one structure with one element as an array of Any[]. That allows me to pass any standard datatype and/or any object pointer in that one simple structure definition. You can also add as many parameters dynamically to the structure at runtime as well. So it's super simple and totally flexible.  ;-)

Regards ... Chris

Comment
  1. Tracy Lamb
  2. Tuesday, 8 March 2022 19:39 PM UTC
That's a great idea! I would just add a boolean called "canceled", since I use it for transferring info to/from response windows... very easy to check whether or not the user canceled the operation.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 8 March 2022 20:14 PM UTC
Hi Tracy;

FYI: You do not need to use any PB variables. Instead, use the CloseWithReturn() command. ;-)

Regards ... Chris
  1. Helpful
There are no comments made yet.
Benjamin Gaesslein Accepted Answer Pending Moderation
  1. Wednesday, 9 March 2022 10:32 AM UTC
  2. PowerBuilder
  3. # 3

Hi Tracy,

as an additional suggestion, I've found PBSearch to be an invaluable tool when it comes to looking for stuff in large PB applications. It makes full-text searches and looking for classes in huge PBL list very easy.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.