Einzelnen Beitrag anzeigen

torud

Registriert seit: 26. Jul 2002
Ort: Sachsen
1.198 Beiträge
 
Delphi XE5 Professional
 
#7

AW: IOC-Code 2 Nationname und zurück

  Alt 7. Jun 2011, 13:55
Jo, danke für das Feedback. Ich habe mich gestern mal hingesetzt und eine Function zusammengezimmert, wenngleich mich das mit der RES-Datei auch sehr interessieren würde.

Hier mal der Code. Achtung, da sind auch ein paar IOC´s drin, die NICHT offiziel sind, aber von dem ein oder anderen Sportverband intern noch so benutzt werden.

Wenn´s mans besser oder einfacher machen könnte, wäre ich über ein Feedback dankbar. Ich würde die Klasse eigentlich gern noch mit den ISO´s und den deutschen Ländernamen erweitern.

Delphi-Quellcode:
function GetCountryNameByIOCCode(IocCode : String) : String;
begin
  Result := '';
  if IocCode = 'AFGthen Result :='Afghanistan';
  if IocCode = 'AHOthen Result :='Netherlands Antilles';
  if IocCode = 'ALBthen Result :='Albania';
  if IocCode = 'ALGthen Result :='Algeria';
  if IocCode = 'ANDthen Result :='Andorra';
  if IocCode = 'ANGthen Result :='Angola';
  if IocCode = 'ANTthen Result :='Antigua and Barbuda';
  if IocCode = 'ARGthen Result :='Argentina';
  if IocCode = 'ARMthen Result :='Armenia';
  if IocCode = 'ARUthen Result :='Aruba';
  if IocCode = 'ASAthen Result :='American Samoa';
  if IocCode = 'AUSthen Result :='Australia';
  if IocCode = 'AUTthen Result :='Austria';
  if IocCode = 'AZEthen Result :='Azerbaijan';
  if IocCode = 'BAHthen Result :='Bahamas';
  if IocCode = 'BANthen Result :='Bangladesh';
  if IocCode = 'BARthen Result :='Barbados';
  if IocCode = 'BDIthen Result :='Burundi';
  if IocCode = 'BELthen Result :='Belgium';
  if IocCode = 'BENthen Result :='Benin';
  if IocCode = 'BERthen Result :='Bermuda';
  if IocCode = 'BHUthen Result :='Bhutan';
  if IocCode = 'BIHthen Result :='Bosnia and Herzegovina';
  if IocCode = 'BIZthen Result :='Belize';
  if IocCode = 'BLRthen Result :='Belarus';
  if IocCode = 'BOLthen Result :='Bolivia';
  if IocCode = 'BOTthen Result :='Botswana';
  if IocCode = 'BRAthen Result :='Brazil';
  if IocCode = 'BRNthen Result :='Bahrain';
  if IocCode = 'BRUthen Result :='Brunei';
  if IocCode = 'BULthen Result :='Bulgaria';
  if IocCode = 'BURthen Result :='Burkina Faso';
  if IocCode = 'CAFthen Result :='Central African Republic';
  if IocCode = 'CAMthen Result :='Cambodia';
  if IocCode = 'CANthen Result :='Canada';
  if IocCode = 'CAYthen Result :='Cayman Islands';
  if IocCode = 'CGOthen Result :='Congo';
  if IocCode = 'CHAthen Result :='Chad';
  if IocCode = 'CHIthen Result :='Chile';
  if IocCode = 'CHNthen Result :='China';
  if IocCode = 'CIVthen Result :='Côte d''Ivoire';
  if IocCode = 'CMRthen Result :='Cameroon';
  if IocCode = 'CODthen Result :='DR Congo';
  if IocCode = 'COKthen Result :='Cook Islands';
  if IocCode = 'COLthen Result :='Colombia';
  if IocCode = 'COMthen Result :='Comoros';
  if IocCode = 'CPVthen Result :='Cape Verde';
  if IocCode = 'CRCthen Result :='Costa Rica';
  if IocCode = 'CROthen Result :='Croatia';
  if IocCode = 'CUBthen Result :='Cuba';
  if IocCode = 'CYPthen Result :='Cyprus';
  if IocCode = 'CZEthen Result :='Czech Republic';
  if IocCode = 'DENthen Result :='Denmark';
  if IocCode = 'DJIthen Result :='Djibouti';
  if IocCode = 'DMAthen Result :='Dominica';
  if IocCode = 'DOMthen Result :='Dominican Republic';
  if IocCode = 'ECUthen Result :='Ecuador';
  if IocCode = 'EGYthen Result :='Egypt';
  if IocCode = 'ENGthen Result :='England';
  if IocCode = 'ERIthen Result :='Eritrea';
  if IocCode = 'ESAthen Result :='El Salvador';
  if IocCode = 'ESPthen Result :='Spain';
  if IocCode = 'ESTthen Result :='Estonia';
  if IocCode = 'ETHthen Result :='Ethiopia';
  if IocCode = 'FIJthen Result :='Fiji';
  if IocCode = 'FINthen Result :='Finland';
  if IocCode = 'FRAthen Result :='France';
  if IocCode = 'FSMthen Result :='Micronesia';
  if IocCode = 'GABthen Result :='Gabon';
  if IocCode = 'GAMthen Result :='Gambia';
  if IocCode = 'GBRthen Result :='Great Britain';
  if IocCode = 'GBSthen Result :='Guinea-Bissau';
  if IocCode = 'GEOthen Result :='Georgia';
  if IocCode = 'GEQthen Result :='Equatorial Guinea';
  if IocCode = 'GERthen Result :='Germany';
  if IocCode = 'GHAthen Result :='Ghana';
  if IocCode = 'GREthen Result :='Greece';
  if IocCode = 'GRNthen Result :='Grenada';
  if IocCode = 'GUAthen Result :='Guatemala';
  if IocCode = 'GUIthen Result :='Guinea';
  if IocCode = 'GUMthen Result :='Guam';
  if IocCode = 'GUYthen Result :='Guyana';
  if IocCode = 'HAIthen Result :='Haiti';
  if IocCode = 'HKGthen Result :='Hong Kong';
  if IocCode = 'HONthen Result :='Honduras';
  if IocCode = 'HUNthen Result :='Hungary';
  if IocCode = 'INAthen Result :='Indonesia';
  if IocCode = 'IN'  then Result :='India';
  if IocCode = 'INDthen Result :='India';
  if IocCode = 'IRIthen Result :='Iran';
  if IocCode = 'IRLthen Result :='Ireland';
  if IocCode = 'IRQthen Result :='Iraq';
  if IocCode = 'ISLthen Result :='Iceland';
  if IocCode = 'ISRthen Result :='Israel';
  if IocCode = 'ISVthen Result :='Virgin Islands';
  if IocCode = 'ITAthen Result :='Italy';
  if IocCode = 'IVBthen Result :='British Virgin Islands';
  if IocCode = 'JAMthen Result :='Jamaica';
  if IocCode = 'JORthen Result :='Jordan';
  if IocCode = 'JPNthen Result :='Japan';
  if IocCode = 'KAZthen Result :='Kazakhstan';
  if IocCode = 'KENthen Result :='Kenya';
  if IocCode = 'KGZthen Result :='Kyrgyzstan';
  if IocCode = 'KIRthen Result :='Kiribati';
  if IocCode = 'KORthen Result :='South Korea';
  if IocCode = 'KSAthen Result :='Saudi Arabia';
  if IocCode = 'KUWthen Result :='Kuwait';
  if IocCode = 'LAOthen Result :='Laos';
  if IocCode = 'LATthen Result :='Latvia';
  if IocCode = 'LBAthen Result :='Libya';
  if IocCode = 'LBRthen Result :='Liberia';
  if IocCode = 'LCAthen Result :='Saint Lucia';
  if IocCode = 'LESthen Result :='Lesotho';
  if IocCode = 'LIBthen Result :='Lebanon';
  if IocCode = 'LIEthen Result :='Liechtenstein';
  if IocCode = 'LTUthen Result :='Lithuania';
  if IocCode = 'LUXthen Result :='Luxembourg';
  if IocCode = 'MADthen Result :='Madagascar';
  if IocCode = 'MARthen Result :='Morocco';
  if IocCode = 'MASthen Result :='Malaysia';
  if IocCode = 'MAWthen Result :='Malawi';
  if IocCode = 'MDAthen Result :='Moldova';
  if IocCode = 'MDVthen Result :='Maldives';
  if IocCode = 'MEXthen Result :='Mexico';
  if IocCode = 'MGLthen Result :='Mongolia';
  if IocCode = 'MHLthen Result :='Marshall Islands';
  if IocCode = 'MKDthen Result :='Macedonia';
  if IocCode = 'MLIthen Result :='Mali';
  if IocCode = 'MLTthen Result :='Malta';
  if IocCode = 'MNEthen Result :='Montenegro';
  if IocCode = 'MONthen Result :='Monaco';
  if IocCode = 'MOZthen Result :='Mozambique';
  if IocCode = 'MRIthen Result :='Mauritius';
  if IocCode = 'MTNthen Result :='Mauritania';
  if IocCode = 'MYAthen Result :='Myanmar';
  if IocCode = 'NAMthen Result :='Namibia';
  if IocCode = 'NCAthen Result :='Nicaragua';
  if IocCode = 'NL'  then Result :='Netherlands';
  if IocCode = 'NEDthen Result :='Netherlands';
  if IocCode = 'NEPthen Result :='Nepal';
  if IocCode = 'NGRthen Result :='Nigeria';
  if IocCode = 'NIGthen Result :='Niger';
  if IocCode = 'NORthen Result :='Norway';
  if IocCode = 'NRUthen Result :='Nauru';
  if IocCode = 'NZ'  then Result :='New Zealand';
  if IocCode = 'NZLthen Result :='New Zealand';
  if IocCode = 'OMAthen Result :='Oman';
  if IocCode = 'PAKthen Result :='Pakistan';
  if IocCode = 'PANthen Result :='Panama';
  if IocCode = 'PARthen Result :='Paraguay';
  if IocCode = 'PERthen Result :='Peru';
  if IocCode = 'PGLthen Result :='Portugal';
  if IocCode = 'PHIthen Result :='Philippines';
  if IocCode = 'PLEthen Result :='Palestine';
  if IocCode = 'PLWthen Result :='Palau';
  if IocCode = 'PNGthen Result :='Papua New Guinea';
  if IocCode = 'POLthen Result :='Poland';
  if IocCode = 'PORthen Result :='Portugal';
  if IocCode = 'PRKthen Result :='North Korea';
  if IocCode = 'PURthen Result :='Puerto Rico';
  if IocCode = 'QATthen Result :='Qatar';
  if IocCode = 'ROUthen Result :='Romania';
  if IocCode = 'RSAthen Result :='South Africa';
  if IocCode = 'RUSthen Result :='Russia';
  if IocCode = 'RWAthen Result :='Rwanda';
  if IocCode = 'SA'  then Result :='South Africa';
  if IocCode = 'SAMthen Result :='Samoa';
  if IocCode = 'SCOthen Result :='Scotland';
  if IocCode = 'SENthen Result :='Senegal';
  if IocCode = 'SEYthen Result :='Seychelles';
  if IocCode = 'SINthen Result :='Singapore';
  if IocCode = 'SKNthen Result :='Saint Kitts and Nevis';
  if IocCode = 'SLEthen Result :='Sierra Leone';
  if IocCode = 'SLOthen Result :='Slovenia';
  if IocCode = 'SMRthen Result :='San Marino';
  if IocCode = 'SOLthen Result :='Solomon Islands';
  if IocCode = 'SOMthen Result :='Somalia';
  if IocCode = 'SRBthen Result :='Serbia';
  if IocCode = 'SRIthen Result :='Sri Lanka';
  if IocCode = 'STPthen Result :='São Tomé and Príncipe';
  if IocCode = 'SUDthen Result :='Sudan';
  if IocCode = 'SUIthen Result :='Switzerland';
  if IocCode = 'SURthen Result :='Suriname';
  if IocCode = 'SVKthen Result :='Slovakia';
  if IocCode = 'SWEthen Result :='Sweden';
  if IocCode = 'SWIthen Result :='Switzerland';
  if IocCode = 'SWZthen Result :='Swaziland';
  if IocCode = 'SYRthen Result :='Syria';
  if IocCode = 'TANthen Result :='Tanzania';
  if IocCode = 'TGAthen Result :='Tonga';
  if IocCode = 'THAthen Result :='Thailand';
  if IocCode = 'TJKthen Result :='Tajikistan';
  if IocCode = 'TKMthen Result :='Turkmenistan';
  if IocCode = 'TLSthen Result :='Timor-Leste';
  if IocCode = 'TOGthen Result :='Togo';
  if IocCode = 'TPEthen Result :='Chinese Taipei';
  if IocCode = 'TRIthen Result :='Trinidad and Tobago';
  if IocCode = 'TUNthen Result :='Tunisia';
  if IocCode = 'TURthen Result :='Turkey';
  if IocCode = 'TUVthen Result :='Tuvalu';
  if IocCode = 'UAEthen Result :='United Arab Emirates';
  if IocCode = 'UGAthen Result :='Uganda';
  if IocCode = 'UK'  then Result :='United Kingdom';
  if IocCode = 'UKRthen Result :='Ukraine';
  if IocCode = 'URUthen Result :='Uruguay';
  if IocCode = 'USAthen Result :='United States';
  if IocCode = 'UZBthen Result :='Uzbekistan';
  if IocCode = 'VANthen Result :='Vanuatu';
  if IocCode = 'VENthen Result :='Venezuela';
  if IocCode = 'VIEthen Result :='Vietnam';
  if IocCode = 'VINthen Result :='Saint Vincent and the Grenadines';
  if IocCode = 'WALthen Result :='Wales';
  if IocCode = 'YEMthen Result :='Yemen';
  if IocCode = 'ZAMthen Result :='Zambia';
  if IocCode = 'ZIMthen Result :='Zimbabwe';
end;
Danke
Tom
  Mit Zitat antworten Zitat