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 70 – PowerBuilder Library

Return values from ancestor scripts – PB Docs 70

Return values from ancestor scripts

If you want to perform some processing in an event in a descendent
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 data type of the AncestorReturnValue variable is always
the same as the data type 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 descendent 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 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 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 only declared and a value
assigned 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