Blockquote
I have multiple windows that all require the same code, w_emp1, w_emp2, w_emp3…. etc. Thus, it seemed prudent to place this common code into a function say wf_access_test.
Each of these windows has its own set of instance variables. Say is_text_name, is_text_town, is_text_zip_code… etc.
The code for wf_access_test() is below. Note that a specific window (w_emp1) has been hardcoded. This allows me to update that specific windows instance variable.
What I need is a method to address the calling window names instance variables, but replace the hardcoded w_emp1 qualifier
w_emp1.is_text_name = ‘Text Updated’ //Updating this windows instance variable - This works!
I have tried calling the function with the window name as a value passed to the function with a argument type = window.
ie. wf_access_test(w_emp_1)
Unfortunately, when I then try and replace the passed value with the hardcoded w_emp1 it states - incompatible property type?
Any experts out there who can help? Many thanks in anticipation.
w_emp.w_empxx(in particular the instance variables that you need).wf_access_testw_empxxas inherited fromw_empDone!
This way, every time you call
wf_access_test, Powerbuilder will take it from the ancestor and use the instance variables from the specific window from which you make the call. Of course, this may require some (or a lot of) work but, in the long run, it is way better. Additional benefit: if you need to change the behaviour of wf_access for a specific windows, you can redefine it at descendent's level.