I have window w_1
in P1.pbl
I have non-visual object n1
in p2.pbl
.
In w_1
having il_ref
. I would like to access the value to n_1 object.
I have window w_1
in P1.pbl
I have non-visual object n1
in p2.pbl
.
In w_1
having il_ref
. I would like to access the value to n_1 object.
There are a variety of ways to accomplish your task.
You can define an instance variable of type n1 on window w_1.
You would then instantiate the variable via a create statement
(unless the object is auto-instantiating)
Methods and variables within i_n1 are now assessable to the window (and vice versa) as long as their scope is designated PUBLIC.
Example of referencing variable on non visual from window method:
If your non visual is already created as a global, don't make a copy on the window, just change the code above to reference the global.
In general, to have access to classes within a .PBL file, that file must be in the library list of the application. In more current versions of PowerBuilder this is maintained in the target (.PBT). There are methods to programmatically change the library list but I won't go into these here.