Overriding a script
To override an ancestor script
-
In the first drop-down list in the Script view, select the
object or a control, and in the second drop-down list, select the
event for which you want to override the script. -
Code a script for the event in the descendant.
You can call the script for any event in any ancestor as
well as call any user-defined functions that have been defined for
the ancestor.For information about calling an ancestor script or
function, see Calling an ancestor
script and Calling an ancestor
function.Override but not execute
To override a script for the ancestor but not execute a
script in the descendant, enter only a comment in the Script
view. -
Select Extend Ancestor Script on the Edit menu or the pop-up
menu to clear the check mark.Clearing the Extend Ancestor Script item means that you are
overriding the script.At runtime, PowerBuilder executes the descendant script when
the event is triggered. The ancestor script is not
executed.
Example of overriding a
script
If the script for the Open event in the ancestor window displays
employee files and you want to display customer files in the
descendant window, select Override Ancestor Script and create a new
script for the Open event in the descendant to display customer
files.