Calling an ancestor function – PB Docs 2017

Calling an ancestor function

When you write a script for a descendant window, user object, or
menu, you can call user-defined functions that have been defined for
any of its ancestors. To call the first function up the inheritance
hierarchy, just call the function as usual:

If there are several versions of the function up the inheritance
hierarchy and you do not want to call the first one up, you need to
specify the name of the object defining the function you want:

This syntax works only in scripts for the descendant object
itself, not in scripts for controls or user objects in the descendant
object or in menu item scripts. To call a specific version of an
ancestor user-defined function in a script for a control, user object,
or menu item in a descendant object, do the following:

  1. Define an object-level user-defined function in the
    descendant object that calls the ancestor function.

  2. Call the function you just defined in the descendant
    script.

For more information about calling an ancestor function, see the
the section called “Calling
functions and events in an object’s ancestor”
in PowerScript Reference.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x