Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

decimal sign 1

Status
Not open for further replies.

fluppe689

Programmer
Jul 11, 2008
75
BE
Hello again Experts,

Is there a way to know how pc is configured with decimal sign = "." or ","


Thanks in advance

Filip
 
Hello Experts

A littel mistake from me i did not mean decimal sign but the sperator sign

wfg,


Filip
 
Hi Filip,

You can do it like this:

1. First, set SYSFORMATS ON. This will ensure that your VFP session respects the user's Windows settings.

2. Issue SET("Separator").

To summarise:

Code:
SET SYSFORMATS ON
lcSep = SET("Separator")
* lcSep now contains the separator symbol

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Hi Mike!

Good point the "Set sysformats on".
Almost forgot that one.

-Bart
 
A little backgorund on SET SYSFORMATS:

It does not permanently overload foxpro settings with windows settings. Eg after SET SYSFORMATS ON you can SET POINT TO ".", even if the system setting is "," and the point setting then will differ from the system setting again, even though SYSFORMATS still is ON.

That maybe unexpected design of the setting also continues, in that SET SYSFORMATS OFF has no meaning, it does not revert settings. Eg I have SET("POINT") as "." by default. Due to german windows settings SET SYSFORMAT ON sets this as "," and SET SYSFORMATS OFF does not revert that. Restarting FoxPro does.

Directly after SET SYSFORMATS ON you can be sure windows settings are taken over into foxpro settings (of course as far as there are similar foxpro settings). Don't check SET("SYSFORMATS") to be "ON" and then rely you read out system settings, that depends on the settings not being overridden again.

Bye, Olaf.
 
Olaf, yes, I agree. That's why I said it will "ensure that your VFP session respects the user's Windows settings". Note the stress on "session".

Filip, all this also brings up the question: why do you need to determine the separator character. If you want your application to respect the Windows setting for the seperator, just set SYSFORMATS on, and continue to format your number strings as before (with the caveats that Olaf mentioned).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Hello Mike,

Thank You Vrey much,
Again you are (like others to) again a great help. A star is born again

Wfg,

Filip
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top