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:
1 |
function ( arguments ) |
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:
1 |
ancestorobject::function ( arguments ) |
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:
-
Define an object-level user-defined function in the
descendant object that calls the ancestor function. -
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.