Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Decimal separator
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00203576
Message ID:
00204940
Views:
15
>>>>If the user is setting the decimal symbol as the , in the control panel, they want to be able to use the numeric keypad . for fast data entry of numbers.
>>>>
>>>>Excel and Access are supporting this, but not VFP. I use Set sysformats ON. The only way I found to enter a decimal is to type on the ,
>>>>
>>>>Any ways to do this?
>>>>
>>>>TIA
>>>
>>>Mario,
>>>
>>>Check SET POINT and SET SEPARATOR in help. Bear in mind they are scoped to the data session.
>>>These values are saved in the REGISTRY under HKEY_CURRENT_USER\Software\Microsoft\VisualFoxPro\5.0\Options.
>>>
>>>
>>>José
>>
>>Thanks Jose, but the set point to "." will force/overwrite Windows setting and this is not what I want. the only way I found is through the keypress event of the textbox (class):
>>If Set("point")="," and nKeyCode = 46
>> keyboard ","
>>endif
>>
>>or the form:
>>If "." $ this.activecontrol.inputmask and Set("point")="," and nKeyCode = 46
>> keyboard ","
>>endif
>>
>>Any better ideas.
>>
>>TIA
>
>Mario,
>
>The clean way to do this would be:
>1. read the SET POINT and SET SEPARATOR settings from the international settings in the OS. You probably need an API call for this. Ask Ed Rauh or George Tasker for this, seems to be their daily bread...
>2. SET these values for your forms. There are several ways to achieve this. Being with Codebook I use a session object that I drop on the form, sets the SET values to my liking and reset them to their default after.
>
>José

Thank you guys, but I probably express myself incorrectly (langage barrier).

I understand that it's cleaner to use set sysfomat on, wich I do and that changes the decimal separator automatically to "." or "," based on the regional settings, my problem was not at this level.

When the decimal separator is a ",", the user cannot use the keypad because there is no "," in the keypad. So I need to transform the "." to a "," when it's entered so the "," will remain the decimal separator. (Try Excel and you'll see that it converts the "." to a "," as you type and VFP doesn't).

That's why I think the only way to convert a character at the input level is to do it in the keypress event of the class, unless you have another idea.

Thanks

Mario
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform