[Home] [Puzzles & Projects] [Delphi Techniques] [Math topics] [Library] [Utilities]
|
|
LOCALE constants are system parameters that describe many items unique to a country or locale. I looked into this when I got into trouble for using commas for numeric field separators and had a user where decimal points are also represented by commas. Not a good situation. I just changed delimiter in that case, but I knew the decimal point character information was buried in Windows somewhere so I decided to dig it out. I counted 104 Locale values including numeric representation, currency representation, country and language names and abbreviations (both local names and English names), day names, month names, and more. You can find the complete list under "Locale Information" in the Windows SDK Help file. If you have Delphi source, unit Windows.pas defines the Locale constants for programs. The Locale fields do not contain the information directly, rather they are index pointers into an internal Windows table. Values are retrieved via the GetLocaleInfoA Windows API function (Delphi maps GetLocaleInfo to GetLocaleInfoA, so either may be used). The demo program that can be downloaded below retrieves and displays a few Locale constants, just to prove that it works.
|
[Feedback] [Newsletters (subscribe/view)] [About me]Copyright © 2000-2018, Gary Darby All rights reserved. |