Currency Symbol

Hi Exports,

I have a small question, How do I get all the Regional Options language list and there currency symbols and values?
S_WarriorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kretzschmarCommented:
usual there is a bunch of variables in the sysutils-unit,
which are initilazed during app-start

see chapter
Currency and date/time formatting variables
in the delphi-help

meikl ;-)
0
S_WarriorAuthor Commented:
no, I need to get the complete list of the languages in the regional settings + currency symbols of every language.
0
kretzschmarCommented:
?? in this list are all countries of the world, except maybe some minor countries
0
S_WarriorAuthor Commented:
Well I need this list + I want every counter currency symbol.
0
Pierre CorneliusCommented:
Here's a demo:

pas:
===

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, DB, Grids, DBGrids, DBClient;

type
  TForm1 = class(TForm)
    rgOption: TRadioGroup;
    Button2: TButton;
    ClientDataSet1: TClientDataSet;
    ClientDataSet1LCID: TIntegerField;
    ClientDataSet1Language: TStringField;
    ClientDataSet1Country: TStringField;
    ClientDataSet1CurrencySymbol: TStringField;
    DBGrid1: TDBGrid;
    DataSource1: TDataSource;
    Label1: TLabel;
    ClientDataSet1currency: TStringField;
    procedure Button2Click(Sender: TObject);
    procedure DBGrid1TitleClick(Column: TColumn);
    procedure FormCreate(Sender: TObject);
  end;

var
  Form1: TForm1;
  LocaleIDs: TStringList;

implementation

{$R *.dfm}

function EnumLCIDs(LCIDStr: pchar): boolean; stdcall;
begin
  LocaleIDs.Add(StrPas(LCIDStr));
  result:= true;
end;

procedure TForm1.Button2Click(Sender: TObject);
var i: integer;
    data: array[0..63] of char;
begin
  LocaleIDs.Clear;
  case rgOption.ItemIndex of
    0: EnumSystemLocales(@EnumLCIDs, LCID_INSTALLED);
    1: EnumSystemLocales(@EnumLCIDs, LCID_SUPPORTED);
  end;

  ClientDataSet1.EmptyDataSet;
  for i:= 0 to LocaleIDs.Count-1 do
  begin
    ClientDataSet1.Append;
    ClientDataSet1LCID.Value:= StrToInt('$'+LocaleIDs[i]);

    GetLocaleInfo(StrToInt('$'+LocaleIDs[i]), LOCALE_SCOUNTRY, data, SizeOf(Data));
    ClientDataSet1Country.Value:= StrPas(data);

    GetLocaleInfo(StrToInt('$'+LocaleIDs[i]), LOCALE_SLANGUAGE, data, SizeOf(Data));
    ClientDataSet1Language.Value:= StrPas(data);

    GetLocaleInfo(StrToInt('$'+LocaleIDs[i]), LOCALE_SCURRENCY, data, SizeOf(Data));
    ClientDataSet1Currency.Value:= StrPas(data);

    GetLocaleInfo(StrToInt('$'+LocaleIDs[i]), LOCALE_SINTLSYMBOL, data, SizeOf(Data));
    ClientDataSet1CurrencySymbol.Value:= StrPas(data);

    ClientDataSet1.Post;
  end;

end;

procedure TForm1.DBGrid1TitleClick(Column: TColumn);
begin
  ClientDataSet1.IndexFieldNames:= Column.FieldName;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  ClientDataSet1.CreateDataSet;
end;

initialization
  LocaleIDs:= TStringList.Create;

finalization
  LocaleIDs.Free;

end.


DFM
===

object Form1: TForm1
  Left = 192
  Top = 114
  Width = 656
  Height = 442
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  DesignSize = (
    648
    408)
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 328
    Top = 16
    Width = 177
    Height = 13
    Caption = 'Click on a heading to sort by that field'
  end
  object rgOption: TRadioGroup
    Left = 112
    Top = 8
    Width = 161
    Height = 35
    Caption = 'LCID option'
    Columns = 2
    ItemIndex = 0
    Items.Strings = (
      'Installed'
      'Supported')
    TabOrder = 0
  end
  object Button2: TButton
    Left = 16
    Top = 8
    Width = 75
    Height = 25
    Caption = 'List/Refresh'
    TabOrder = 1
    OnClick = Button2Click
  end
  object DBGrid1: TDBGrid
    Left = 16
    Top = 48
    Width = 614
    Height = 347
    Anchors = [akLeft, akTop, akRight, akBottom]
    DataSource = DataSource1
    TabOrder = 2
    TitleFont.Charset = DEFAULT_CHARSET
    TitleFont.Color = clWindowText
    TitleFont.Height = -11
    TitleFont.Name = 'MS Sans Serif'
    TitleFont.Style = []
    OnTitleClick = DBGrid1TitleClick
  end
  object ClientDataSet1: TClientDataSet
    Aggregates = <>
    Params = <>
    Left = 240
    Top = 8
    object ClientDataSet1LCID: TIntegerField
      DisplayWidth = 12
      FieldName = 'LCID'
    end
    object ClientDataSet1Country: TStringField
      DisplayWidth = 31
      FieldName = 'Country'
      Size = 50
    end
    object ClientDataSet1Language: TStringField
      DisplayWidth = 25
      FieldName = 'Language'
      Size = 50
    end
    object ClientDataSet1currency: TStringField
      DisplayLabel = 'Currency'
      FieldName = 'currency'
      Size = 10
    end
    object ClientDataSet1CurrencySymbol: TStringField
      DisplayWidth = 15
      FieldName = 'CurrencySymbol'
      Size = 3
    end
  end
  object DataSource1: TDataSource
    DataSet = ClientDataSet1
    Left = 272
    Top = 8
  end
end

Regards
Pierre
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.