Locale Constants Demo

[Home]   [Puzzles & Projects]    [Delphi Techniques]   [Math topics]   [Library]   [Utilities]

 

 

Search

Search WWW

Search DelphiForFun.org

As of October, 2016, Embarcadero is offering a free release of Delphi (Delphi 10.1 Berlin Starter Edition ).     There are a few restrictions, but it is a welcome step toward making more programmers aware of the joys of Delphi.  They do say "Offer may be withdrawn at any time", so don't delay if you want to check it out.  Please use the feedback link to let me know if the link stops working.

 

Support DFF - Shop

 If you shop at Amazon anyway,  consider using this link. 

     

We receive a few cents from each purchase.  Thanks

 


Support DFF - Donate

 If you benefit from the website,  in terms of knowledge, entertainment value, or something otherwise useful, consider making a donation via PayPal  to help defray the costs.  (No PayPal account necessary to donate via credit card.)  Transaction is secure.

Mensa® Daily Puzzlers

For over 15 years Mensa Page-A-Day calendars have provided several puzzles a year for my programming pleasure.  Coding "solvers" is most fun, but many programs also allow user solving, convenient for "fill in the blanks" type.  Below are Amazon  links to the two most recent years.

Mensa® 365 Puzzlers  Calendar 2017

Mensa® 365 Puzzlers Calendar 2018

(Hint: If you can wait, current year calendars are usually on sale in January.)

Contact

Feedback:  Send an e-mail with your comments about this program (or anything else).

Search DelphiForFun.org only

 

 

 

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.  

Download Source 

Created: February 10, 2004

Modified: May 12, 2018

   

  [Feedback]   [Newsletters (subscribe/view)] [About me]
Copyright © 2000-2018, Gary Darby    All rights reserved.