Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can we do this? 1

Status
Not open for further replies.

ranjitvictor

Programmer
Jul 29, 2000
11
IN
Is it possible to overload constructors in PB. I am new to this language so please keep it simple!
 
In NVOs (non visual objects) or CVUOs (custom visual user objects) the constructor event may either override or extend its ancestor's script. The default behaviour of any PB event is to extend (ancestor code is executed first, then descendent code is executed). If you are working in PB7, you can RMB click anywhere in the whitespace of the script painter (while viewing the constructor event) and you will see in the pop-up menu a menu item called "Extend Ancestor Script". If the there is a tick next to this item, then the contructor event for the ancestor of the current object (the object you are viewing the script for), then the current script that is written there - extends the ancestor's script. Alternatively, if there is not tick - then the current script overrides the ancestor script. As far as I know its not possible to overload PB events.
Hope this helps. Let me know if you need more info.
 
I have here a Powerbuilder 8.0 application that seems to use overload on PB user events. uo_dw has an event called ue_retrieve. uo_dw is a datawindow user object. ue_retrieve is a user event with no arguments and a long return value. uo_dw is placed on w_sheet as dw_datawindow and has ue_retrieve with no return value and 4 arguments. It works like a charm, but I haven't found out yet how it was done. The application is not mine, but I am responsible for maintaining it.

If anyone knows how to overload events, please join this thread!

Keywords:
- overload event
- overloading events
- polymorphism
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top