>
>Use DODEFAULT() whenyou want to execute the code (if any) in the same method in the parent class unless the parent class is a VFP base class. VFP base class behavior automatically executes after any custom code in the method is executed.
>
>To prevent the VFP base class behavior from being executed, use NODEFAULT.
>
>IF you want the VFP base class behavior to execute
beforethe custom code in you method, do not use DODEFAULT(). Use the scope resolution operator followed by a NODEFAULT like so:
>
>TextBox::GotFocus()
>*** My custom code here
>NODEFAULT
>
>The reason you need the scope resolution operator to execute the base class behavior is that DODEFAULT() only executes the code in the parent class. It does
notexecute the VFP base class behavior unless the parent class
is the base class.
>
>There used to be a bug in VFP 5.0 that caused the base class behavior to be executed when a DODEFAULT() was issued in a method. This has the net effect causing the base class behavior to be executed twice: once because of the DODEFAULT() and once after the custom code. This bug was fixed in VFP 6.0 (and broke some code, too, when it was fixed).
>
>Marcia
Best explanation ever, short, clear and to the point.
That behaviorial difference between VFP5 and VFP6 is what had me confused, we have systems using both versions at this time. Now I can check/fix by base classes with confidence.
Thank you very much, Marcia, hope to meet you and other gurus in San Diego,
- $$ permiting :) -
...Y soy feliz, bien feliz, asi lo grito;
Mira, que el mundo sepa, que se sepa:
Soy feliz....
...And I'm happy, quite happy, so do I yell it;
Look, so the world knows it, so be known:
I'm happy...
Ismael Rivera "Oye cosita linda"
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only