Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return .f. still allows exit from field. Why?
Message
From
28/08/1999 18:02:41
 
 
To
27/08/1999 19:10:12
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00258304
Message ID:
00258871
Views:
11
>>What version of VFP?
>
>6 - sp3
>
>
>>There is a bug in 5.0 that would cause this. The fix was to add DODEFAULT().
>
>I'll try that, but WHERE do you add it?
>

When you subclass something and want to extend the functionality, you need to determine whether it supplements the inherited code or supplants the code. If it supplants (completely replaces), then your code should never execute a DODEFAULT, and in fact, if base class behavior should be filtered, a NODEAULT should be added to the code.

If my code enhances the parent class code, I need to decide if I filter out the conditions under which the parent class acts, or if I want to act after the default behavior. I use the following contructs:
*Enhance after the basic functionality is used
LOCAL uReturn
uReturn = DODEFAULT() && catch parent's return and save
DO CASE
CASE <i>something that this handles afterwards</i>
   *do some stuff
   uReturn = <i>whatever I want returned</i>
CASE <i>something else that this handles afterwards</i>
   *do some stuff
   uReturn = <i>whatever I want returned</i>
ENDCASE
RETURN uReturn

*Filter where the base code executes only when I don't
LOCAL uReturn
uReturn = <i>some default in case I get stupid</i>
*  If I want to block base class behavior, too, add a NODEFAULT
DO CASE
CASE <i>something that this handles instead of parent's</i>
   *do some stuff
   uReturn = <i>whatever I want returned</i>
CASE <i>something else that this handles instead of parent's</i>
   *do some stuff
   uReturn = <i>whatever I want returned</i>
OTHERWISE
   uReturn = DODEFAULT() && catch what would normally come back
ENDCASE
RETURN uReturn
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform