CALL

Description

Calls an ancestor script from a script for a descendant object. You can call scripts for events in an ancestor of the user object, menu, or window. You can also call scripts for events for controls in an ancestor of the user object or window.

When you use the CALL statement to call an ancestor event script, the AncestorReturnValue variable is generated. For more information on the AncestorReturnValue variable, see About events.

Syntax

CALL ancestorobject {`controlname}::event

Parameter

Description

ancestorobject

An ancestor of the descendant object

controlname (optional)

The name of a control in an ancestor window or custom user object

event

An event in the ancestor object


Usage

Using the standard syntax

For most purposes, you should use the standard syntax for calling functions and events. For more information about the standard syntax, see Syntax for calling PowerBuilder functions and events.

The standard syntax allows you to trigger or post an event or function in an ancestor and then pass arguments, but it does not allow you to call a script for a control in the ancestor.

In some circumstances, you can use the pronoun Super when ancestorobject is the descendant object's immediate ancestor. See the discussion of Super pronoun.

If the call is being made to an ancestor event, the arguments passed to the current event are automatically propagated to the ancestor event. If you call a non-ancestor event and pass arguments, you need to use the new syntax, otherwise null will be passed for each argument.

Examples

Example 1

This statement calls a script for an event in an ancestor window:

CALL w_emp::Open

Example 2

This statement calls a script for an event in a control in an ancestor window:

CALL w_emp`cb_close::Clicked