Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get regional configuration ?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MySQL
Miscellaneous
Thread ID:
01136929
Message ID:
01137016
Views:
24
This message has been marked as the solution to the initial question of the thread.
Ricardo,

You can try using the country information that is registered in the OS, I am no sure if it is the same as the one in "Regional Settings", in the quick test I just did, I changed my country To be "Ecuador" in it and the code still gave me "2" (Canada) as the country, so maybe it helps you, although it might also be that I changed the country in the wrong place, but you can easily test it.

The code would be something like this:
* Requirements
* Client: Included in Windows XP, Windows 2000 Professional, Windows NT Workstation 4.0 SP4 and later.
* Server: Included in Windows Server 2003, Windows 2000 Server, Windows NT Server 4.0 SP4 and later.


loLocator			= CREATEOBJECT('WBEMScripting.SWBEMLocator')
loWMI				= loLocator.ConnectServer()
loOSs				= loWMI.ExecQuery('Select * from Win32_OperatingSystem where Primary=True')

for each loOS in loOSs
	? 'Locale: ', loOS.Locale, 'Country Code:', loOS.CountryCode
endfor
where, from the help:

CountryCode
Data type: string
Access type: Read-only

Code for the country/region that an operating system uses. Values are based on international phone dialing prefixes—also referred to as IBM country/region codes. The property can use up to six characters to define the country/region code value.

Example: "1" (United States)
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Reply
Map
View

Click here to load this message in the networking platform