RE: VFP6 & OOP - newbie question

Author: Gene Wirchenko, genew@shuswap.net

Posted: 1999-09-14 at 12:59:28

>As I understand inheritance (if I'm confused somebody straighten me out)

>

>When you put code in the child property you are overriding the code that is

>in the parent class, thus the behavior that you note. DODEFAULT()

>explicitly calls the code of the parent class just as NODEFAULT explicitly

>prevents the parent code from running.

Uh, not quite on the nodefault. If there is one, then the parent class

code is already being overridden because you have code in the child method

(if only the nodefault). The nodefault prevents the baseclass method

"associated action" (I can't think of a better term.) from being done.

For example, keypress has a base class associated action of adding the

keystroke to the control's input. nodefault says to not do that, so the

character gets thrown away.

I think (I haven't tried it, but see no reason why it wouldn't work.)

that you could have both dodefault() and nodefault executed in the same run

of a method and it would work.

With the above example, the parent might have a list of throwaway

characters and the child might call it and have its own add-on list. At the

end of the child, there could be a test if the character is to be tossed and

if so, a nodefault.

[snip]

Sincerely,

Gene Wirchenko

genew@shuswap.net

Computerese Irregular Verb Conjugation:

I have preferences.

You have biases.

He/She has prejudices.

©1999 Gene Wirchenko, genew@shuswap.net