Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return .f. still allows exit from field. Why?
Message
From
29/08/1999 10:29:32
 
 
To
28/08/1999 22:28:46
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00258304
Message ID:
00258964
Views:
9
>>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
>
>
>You sir, are a natural and gifted teacher! That finally rammed it into my head.
>
>I was indeed adding a further condition and a dodefault in the form intantiation. At first I thought, move it to the lostfocus and let the valid reset to default, but then, following the logic of your extremely helpful example, I figured if I just put the following lines in front of my additional condition it should work:
>

Glad it finally worked out for you. It's one of those things where when it finally clicks, it seems too simple...
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
Reply
Map
View

Click here to load this message in the networking platform