Using inherited scripts

In the hierarchy formed by ancestors and descendants, each descendant inherits its event scripts from its immediate ancestor. If an inherited event does not have a script, you can write a script for the event in the descendant. If the inherited event does have a script, the ancestor script will execute in the descendant unless you extend the script or override it. You can:

You cannot delete or modify an ancestor script from within a descendant.

Executing code before the ancestor script

To write a script that executes before the ancestor script, first override the ancestor script and then in the descendent script explicitly call the ancestor script at the appropriate place. For more information, see “Calling an ancestor script”.

Getting the return value of the ancestor script

To get the return value of an ancestor script, you can use the AncestorReturnValue variable. This variable is always available in descendent scripts that extend an ancestor script. It is also available if you override the ancestor script and use the CALL syntax to call the ancestor event script. For more information, see the chapter on using the PowerScript language in the Resource Guide.