Overriding a script

StepsTo override an ancestor script:

  1. 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.

  2. 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”.

    NoteOverride 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.

  3. Click on Extend Ancestor Script on the Edit menu or the pop-up menu to clear the check mark.

    You do not want Extend Ancestor Script selected. Not extending the ancestor script means that you are overriding the script.

During execution, PocketBuilder executes the descendent 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 descendent window, create a new script for the Open event in the descendant to display customer files, and clear the check mark for the Extend Ancestor Script menu item.