1
votes

I'm trying to be able to return a datawindow object from a user object in a powerbuilder method?

Let's say my user object has a datawindow on it called: dw_info. I want to have a function on my user object that will allow me to return that dw called uf_get_dw_info(). This return type will be dw_info.

If I need to work with this from a window that contains my user object, I want to be able to call: userobject.uf_get_dw_info().acceptext();

Is this possible?

1

1 Answers

3
votes

If you find yourself wanting to reach into an object in the way you describe, instead add a public function on the container that does the thing you want. If this causes you to need many such functions, you need to reconsider your objects' responsibilities. If you are early in your project you may want to consider using PFC which handles many of these issues for you.

To answer your question, just type datawindow in the return type of the function. The body is return dw_info.