Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SET POINT and numeric input
Message
From
14/01/2002 18:11:22
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
11/01/2002 06:47:32
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00603396
Message ID:
00604639
Views:
24
This message has been marked as a message which has helped to the initial question of the thread.
>Users typically input lots of numbers with the numeric keypad, but when the Control Panel defines the decimal "point" as a comma, the point is not accepted. This is awkward for quick data entry.
>
>Does anyone have a satisfactory solution for this? I want to continue using SET SYSFORMATS ON. I think several approaches are possible in theory, including a) temporarily changing SET POINT for the control that has the focus (how?), b) converting commas to points in .KeyPress().

In DOS days this was no problem. The point key on numeric keypad was giving out a comma in languages which had the decimal comma and point separator. Why has M$ changed this in Windows is beyond me.

Here's how I solved this. In my textbox class, there's a property lExpectsComma. In the .gotfocus there is
this.lExpectsComma=SET("Point")="," and TYPE(this.ControlSource)="N"
and there's this code in .KeyPress:
case this.lExpectsComma and nKeyCode=46	&& point
   dodefault(44,0)	&& make it a comma
   nodefault
...and that's all. I don't recommend using On Key Label for stuff like this, because it may still be active if something happens that leaves the focus on the textbox (like anything on the toolbar - toolbar controls leave the focus there).

back to same old

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

Click here to load this message in the networking platform