Extending & Overriding Events
\The Sandbox \PB History & Future \New In PB6 \Ease of Use & PowerScript \AncestorReturn- Value \Extending &  Overriding
Extending & 
Overriding

Extending event scripts

The AncestorReturnValue variable is always available in extended event scripts. When you extend an event script, the PowerScript painter generates the following syntax and inserts it at the beginning of the event script:

CALL SUPER::event_name

You only see the statement if you export the syntax of the object.

Overriding event scripts

The AncestorReturnValue variable is only available when you override an event script after you call the ancestor event using the CALL syntax:

CALL SUPER::event_name

or

CALL ancestor_name::event_name

The compiler cannot differentiate between the keyword SUPER and the name of the ancestor. The keyword is replaced with the name of the ancestor before the script is compiled.

The AncestorReturnValue variable is only declared and a value assigned when you use the CALL event syntax. It is not declared if you use the new event syntax:

ancestor_name::EVENTevent_name( ). 

Example

You can put code like the following in an extended event script:

IF AncestorReturnValue = 1 THEN
// execute some code
ELSE
// execute some other code
END IF

You can use the same code in a script that overrides its ancestor event script, but you must insert a CALL statement before you use the AncestorReturnValue variable:

// execute code that does some preliminary processing
CALL SUPER::ue_myevent
IF AncestorReturnValue = 1 THEN
PBL Peeper PB Help PB History
& Future About Us Feedback Site Map

Google
 
Web www.techno-kitten.com
www.sybase.com