Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Return values from ancestor scripts – PB Docs 2021 – PowerBuilder Library

Return values from ancestor scripts – PB Docs 2021

Return
values from ancestor scripts

If you want to perform some processing in an event in a descendant
object, but that processing depends on the return value of the ancestor
event script, you can use a local variable called AncestorReturnValue that
is automatically declared and assigned the return value of the ancestor
event.

The first time the compiler encounters a CALL statement that calls
the ancestor event of a script, the compiler implicitly generates code
that declares the AncestorReturnValue variable and assigns to it the
return value of the ancestor event.

The datatype of the AncestorReturnValue variable is always the same
as the datatype defined for the return value of the event. The arguments
passed to the call come from the arguments that are passed to the event in
the descendant object.

Extending event scripts

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

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

Overriding event scripts

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

or

The compiler does not 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 declared and a value assigned
only when you use the CALL event syntax. It is not declared if you use the
new event syntax:

Example

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

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:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x