Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox little problem
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00512876
Message ID:
00513667
Views:
20
This message has been marked as a message which has helped to the initial question of the thread.
Hi Agustin.

>> There is a rule on where to use DODEFAULT and where not? <<

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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform