Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use nodefault in VFP6?
Message
 
 
To
05/12/2000 13:17:04
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00449463
Message ID:
00449570
Views:
7
>>>>Hello all,
>>>>I have notice the nodefault option in define class command,
>>>>what the 'nodefault' affect? I don't understand what the MSDN library say.
>>>
>>>In plain English it says 'do not do default action'. Suppose you have this code in keypress :
>>>
>>>
if nKeyCode = asc('Z')
>>>  nodefault
>>>endif
Absorbs all Z input. Or as another example, say you want to check something in lostfocus and do not leave the control if it fails (like valid) :
>>>
>>>
if llNotSatisfied
>>>   nodefault
>>>   this.Setfocus()
>>>else
>>>endif
Try this with nodefault. Only built-in methods/events are effected by it AFAIK.
>>>Cetin
>>
>>Cetin,
>>
>>Exactly that I did in LostFocus yesterday. But I don't need the third line :) Or I was just lucky? :)
>
>Sometimes you do :) Try with SelectOnEntry.
>Cetin

Thanks, I'll try :) BTW, it's for EditBox - remember your suggestion of normalize()? This function trows an error on empty string. Therefore I check in LostFocus of IndexExpr if it's empty, and in this case display a message and nodefault. For FilterExpr I check, if it's not empty, before using normalize().

Great tip, thanks again.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform