Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ingrid Problem
Message
From
18/07/1998 16:33:05
 
 
To
16/07/1998 15:45:18
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00116648
Message ID:
00119023
Views:
28
>>Hi, Alex
>>
>>One command in the KeyPress event should be modified as follows to cover the "0" situation:
>>
>> CASE BETWEEN(m.nKeyCode, 48, 126) OR m.nKeyCode=32 && AlphaNumeric
>>
>>To increase the key reset time, change the _DBLCLICK setting (The default is 0.5 second)
>
>I'll stop writing this, but I have a feeling everyone's forgotten it: BETWEEN(m.nKeyCode, 48, 126) doesn't cut it. Whoever wrote it first, obviously had a very narrow definition of what is an alphanumeric and what is not. This works in codepage 1252 and only in 1252. Any other codepage uses codes beyond 127 up to 254. The function IsAlpha() reflects this quite OK (i.e. it complies to the codepage defined in config.fpw) thus making your code independent of codepage.

A good point. Also, I don't know if the control has been revised lately, but here is another trap to watch out for: by default it does a LOCATE first, then a SEEK() - which if you are working on a big table can really bite you, timewise. You might watch out for that.
Dan LeClair
www.cyberwombat.com
SET RANT ON - The Wombat Blog

Life isn’t a morality contest and purity makes a poor shield. - J. Peter Mulhern
Disclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform