DODEFAULT and the scope resolution operator (aka "::"
This is NOT a third grade question...
DODEFAULT() means "run the code in the parent version of this class".
You need this when a subclass has *any* code in the event/method.
For example, say you had a command button class where the click() event ran a wave file that made a "click" sound.
When you dropped that command button onto a form and put some code in the button's click event, the wave file would not be run unless you included the DODEFAULT() command in the event code:
*** in MyClass.vcx
DEFINE CLASS cmdBtnClick AS cmdButton
... YadaYadaYada
FUNCTION Click
SET BELL TO Click.Wav
? CHR(7)
SET BELL TO
RETURN
... YadaYadaYada
ENDDEFINE
*** in MyForm.scx
DEFINE CLASS cmdHello AS cmdBtnClick
... YadaYadaYada
FUNCTION Click
*** there will be no "click" sound
WAIT WINDOW "Hello World"
RETURN
... YadaYadaYada
ENDDEFINE
*** in MyForm.scx
DEFINE CLASS cmdHello AS cmdBtnClick
... YadaYadaYada
FUNCTION Click
*** "click" sound
DODEFAULT()
WAIT WINDOW "Hello World"
RETURN
... YadaYadaYada
ENDDEFINE
That's the story for DODEFAULT().
********************************
Scope resolution operator
Using the classes from the previous DODEFAULT discussion, lets say that you subclassed cmdBtnClick so that it did some really neat stuff and looked really cool. But, being a miscevious sort, it also made a rude noise when clicked:
DEFINE CLASS cmdRazzer AS cmdBtnClick
... YadaYadaYada
FUNCTION Click
SET BELL TO Razzer.Wav
? CHR(7)
SET BELL TO
RETURN
... YadaYadaYada
ENDDEFINE
One day, you realized that you need the neat functionality of cmdRazzer for something, but would probably get fired if the new button made that rude noise. And it would be a very
good thing if the button made the nice little "click" sound... but you reeealy need that other neat stuff in cmdRazzer:
DEFINE cmdSaveMyButt AS cmdRazzer
... YadaYadaYada
FUNCTION Click
LOCAL lcParent, lcCallClick
WITH THIS
m.lcParent = .PARENT
m.lcCallClick = m.lcParent = "::CLICK()"
*** run the click event code in class cmdBtnClick
&lcCallClick
ENDWITH
RETURN
... YadaYadaYada
ENDDEFINE
So in summary, DODEFAULT() goes down the inheritance chain until it finds a parent/grandparent/greatgrandparent with event/method code to run and then VFP runs that code... VFP goes no further.
In contrast, if you want to run a specific level of inherited event code, you can specifiy that level with the scope resolution operator ("::"

.
I think a big problem with "::" is that MS has not implemented it very well in VFP (macros suck) and the documentation is even worse.
Regards,
Thom C.