maillist@pvxplus.com

Message: previous - next
Month: January 2002

RE: [Pvx] *OOP inheritance and on_create

From: Terry Bauer <terry.bauer@...>
Date: Thu, 17 Jan 2002 14:22:58 -0600
Jeff,

I can answer your first question, cause I've "been there and done that."

To guarantee that a child object inherits the ON_CREATE logic you must use
the REQUIRED directive in your class definition for the class, as in:

DEF CLASS "ParentClass" CREATE REQUIRED

..... definitions .....

END DEF

DEF CLASS "ChildClass"

.... definitions ....
LIKE "ParentClass"
END DEF

If the ON_DELETE logic is required, you need to add this to the class
definition as well.  And, you can supply optional labels for this logic
(instead of ON_CREATE and ON_DELETE).  So, you could have a class definition
that looks like this:

DEF CLASS "ParentClass" CREATE PARENTCLASS.INITIALIZE REQUIRED DELETE
PARENTCLASS.FINALIZE REQUIRED

END DEF

Please note, however, the optional label for the delete logic was broken in
5.0.  It has been resolved in 5.01.

Also, your child class can override the method of a parent class and still
inherit the functionality of the method of the parent class.  If you would
like to know how that is done, let me know.....

Hope it helps,

Terry Bauer
Business Computer Systems
San Antonio-Houston 
terry.bauer@...
http://www.bcs-tx.com
 

> -----Original Message-----
> From: Jeff Johnson [mailto:jeffj@...]
> Sent: Thursday, January 17, 2002 2:04 PM
> To: Providex List
> Subject: [Pvx] *OOP inheritance and on_create
> 
> 
> Hi,
> 
> I was just messing around with inherited objects, trying to 
> make sure I
> understand the rules.
> 
> Can someone explain to my why the on_create logic is not inherited by
> default and how to cause the on_create logic to be inherited.
> 
> 
> As long as I'm asking dumb questions about objects.  From 
> console mode I
> can set 'NE' and break plant an exit in an object method.  I get all
> kind of error reports when I hit the escape, but I get to . trace the
> program with the variables in tact.
> 
> Is there a better way to step through program logic inside a class
> definition?
> 
> Jeff
> 
> 
> 
>