Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: PowerBuilder
Expertise: Beginner
Jul 24, 1997

How to determine ancestor's return value from its descendant

Question:
How can I determine the return value of an ancestor event from its descendant?

For example, the PFC_addrow event of the PFC datawindow. If I were to extend this event, I would like to know the number of the added row (return value of PFC_addrow).

Any clues?

Answer:
There is no way to get the return value from an ancestor event. However, there is a way to do what you want. In your descendant script, overload the event for which you want the return value. Then in your new descendant event, call the ancestor event code and capture the return value locally, then process your script as normal.

In the following piece of sample code, I have created a user object with an event called ue_ken, which takes no parameters but returns a string. In my window I have placed a copy of the control and overloaded the ue_ken event. The following code is used to call the ancestor event and capture the return value:

// OVERLOADED EVENT! BE CAREFUL.
String ls_Val

// Call ancestor script
ls_Val = super::TRIGGER STATIC EVENT ue_ken()

// My custom processing!
// ...
// ...

RETURN ls_Val
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date