Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DODEFAULT with parameters
Message
From
31/07/2001 18:37:36
 
 
To
31/07/2001 18:26:48
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00538014
Message ID:
00538082
Views:
12
>By "default classes" I'm assuming you mean VFP's native base classes.

Yes

>
>As for the Error() event: just having any Error event code is going to swallow the error unless you handle it. Even if you DoDefault().
>VFP's native error handler will only fire the event, it won't raise it.

Ok I got by this one.


>
>For other events and methods of subclasses off the native VFP classes, you don't need to call DoDefault() unless it's right in the middle of the code you want to handle - if so, you would also need a NoDefault after it so the behavior doesn't occur twice: it always occurs after your custom code unless you have the NODEFAULT keyword in there.
>
>KeyPress(): What's your code doing? You may need to use NODEFAULT to suppress the behavior you don't want, instead of trapping the behavior you do.

I am processing a grid from a parameterized view using gcLastFirst as the parameter. So, the native default code is fine but I want a current This.Value to process to the gcLastFirst var. Hense the dodefault, my code ... syntax.



>e.g. no digits allowed in a textbox (I know there's other ways to do this, but it's an easy example).
>
>LPARAMETERS nKeyCode, nShiftAltCtrl
>If IsDigit(Chr(nKeyCode))
>  NoDefault
>EndIf
>
>>This is a dumb one but it is bugging me.
>>
>>Several methods in the default classes (which I have subclassed) use predefined methods that receive parameters. For example most Error methods receive nError, cMessage, nLine & the Keypress event gets nKeyCode, nShiftAltCtrl. I like to add capability to these methods and am having trouble calling the default code.
>>
>>In Error's case I have used DODEFAULT(nError,cMessage,nLine) to allow those errors I don't trap to be processed normally. But nothing seems to happen using this syntax. I have had to find some code from another component and paste it in instead of the dodefault.
>>
>>In Keypress again I added DODEFAULT(nKeyCode, nShiftAltCtrl). This caused the object to only be one character long and the value to contain only the last character typed. Again I programmed around it with custom code all the way.
>>
>>Obviously, I would prefer not to custom code everything if I can help it. It is ineffient and prone to unforseen errors.
>>
>>Anyone got some ideas on this obviously dumb question
>>
>>Thanks in advance
>>
>>Terry
It is impossible to make programs idiot proof. Idiots are too cleaver.

MCP( Tcp/Ip )
Previous
Reply
Map
View

Click here to load this message in the networking platform