>>Hi, I have an issue with creating CSV files since a recent windows update. With certain settings at a client, COPY TO TYPE CSV produces an incorrect file format. Therefore I like to prepare the file in code, however I would need to detect the setting in regional settings, which regional number format is selected. I found the GetLocaleInfoEx API but have not yet found how exactly to use it for the number format. So I am hoping someone has done that already?
>
>Quick and dirty:
>set date short
>x=dtoc({^1999-12-31})
>
>Then analyze x and see what got where.
Since this is an oddness all the time if your decimal comma is not a point, my approach is to use my environment class to store all settings, set the date, point etc to what I need and then reset. Same for APPEND FROM.
So, just give a damn what is current on your system, set what you need
-figure out what is wrong
lvX = SET(xx)
SET xx ..
COPY TO ...
SET xx [lvx]
Also, ignore .. TO CSV, use DELIMITED with it's parameters and just copy the header on top of it. This you can create with AFIELDS(). DELIMITED give better control.
HTH
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]