Link to home
Start Free TrialLog in
Avatar of CartoonJon
CartoonJon

asked on

Locating response windows

Here is the situation...

The application has frame window.  This frame window has an instance of a custom user object and that object has a function.  That function has one argument passed into it, a window argument passed by value.  That window would be the frame window.  In the function I need to search through all the open windows in the application to find the one that matches the name of a window pulled from a database.  Unfortunately this application has a few windows that are opened as response windows instead of sheets in the frame.  I need to be able to find these windows too, but I cannot do it with just the GetFirstSheet() and GetNextSheet() functions.

Does anyone have any suggestions?

Thanks in advance

CartoonJon
ASKER CERTIFIED SOLUTION
Avatar of EAServer
EAServer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CartoonJon
CartoonJon

ASKER

That's a great solution, but unfortunately this application is huge and resources are stretched.  So keeping an array of open windows is a last resort solution.  Is there any other way accomplish this task?  Does powerbuilder keep track of open windows in any way that I can tap into.
Actually an array of windows won't add much if any strain to your resources.  The array elements are just reference variables, so they only hold the address of the window not the entire window.  Basically it is the equivalent to having an array of longs, as far as memory is concerned.  I can't think of a more efficient way to accomplish your task.  Also, while there are a ton of windows in your application it's unlikely that a user would have more than 10 open at a time.  If you code the function that populates the array properly, the array will never be bigger than the maximum number of windows the user opens during a session.

Thanks a bunch.
Actually an array of windows won't add much if any strain to your resources.  The array elements are just reference variables, so they only hold the address of the window not the entire window.  Basically it is the equivalent to having an array of longs, as far as memory is concerned.  I can't think of a more efficient way to accomplish your task.  Also, while there are a ton of windows in your application it's unlikely that a user would have more than 10 open at a time.  If you code the function that populates the array properly, the array will never be bigger than the maximum number of windows the user opens during a session.