Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Input format
Message
From
27/11/2009 13:24:01
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
27/11/2009 09:02:49
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01436658
Message ID:
01436765
Views:
63
>>>Another more felxible solution is
>>>if !upper(chr(nKeyCode))$"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 "
>>>   nodefault
>>>endif
>>
>>Good morning. (Well, afternoon in your case). Why is that more flexible?
>
>I would guess that if I wanted to include other specific characters (say * or %) I could include them in the string very easily.

Still doesn't translate too well for other codepages. Even chr(255) can be a valid character somewhere. VFP's isalpha() function works fine for those, so you'd be better off building this string once early (in the init of an object), to include any characters for which isdigit() or isalpha() return .t., plus your personal assortment of punctuation. Then everything else is rejectable.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform