PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Returns the list of all countries or countries of a given continent according to ISO 3166-1.
Remark: The list of countries is the one defined by the ISO 3166-1 standard at 15/10/2019.
Example
// Initialize the list of countries
arrCountryList is array of Countries = CountryList()
FOR EACH oCountry OF arrCountryList
ListAdd(LIST_CountryList, oCountryName)
END
 
// Fill a Table control with the list of countries
// (as well as information about each country).
arrCountryList is array of Countries = CountryList()
FOR EACH oCountry OF arrCountryList
TableAddLine(TABLE_Country, oCountry.Name, oCountry.ISOCode2, oCountry.ISOCode3, ...
oCountry.ISOCodeNum, oCountry.Continent.Name, oCountry.Flag, ...
oCountry.Nation, oCountry.PhoneNumberPrefix)
END
// This example shows how to fill in a Combo Box control with the list of European countries.
// The caption of the country is displayed.
// The numeric code of the country is stored.
// The code of the country is stored and retrieved using gStoredValue.
//---------------------------------------------------------------
// -- Initialize the Combo Box control
arrCountryList is array of Countries = CountryList(continentEurope)
gStoredValueEnable(COMBO_Country, True)
FOR EACH oCountry OF arrCountryList
ListAdd(COMBO_Country, oCountry.Name + gStoredValue(oCountry.ISOCode3))
END
//--------------------------------------------------------------
// -- Selecting a row in the Combo Box control
Info("The name of the country is: " + COMBO_Country.DisplayedValue, ...
"The country code is: " + COMBO_Country.StoredValue)
Syntax
<Result> = CountryList([<Continent>])
<Result>: Array of Country variables
Array of Country variables that contains the list of countries.
<Continent>: Optional character string, optional Continent variable or optional constant
Continent for which countries must be listed. This parameter can correspond to:
  • a variable of type Continent,
  • the caption of the desired continent (in English, Spanish or French).
  • a constant that identifies the continent (or 2-character continent code):
    continentAfricaAfrica (constant set to "AF").
    continentNorthAmericaNorth America (constant set to "NA").
    continentSouthAmericaSouth America (constant set to "SA").
    continentAntarcticaAntarctica (constant set to "AN").
    continentAsiaAsia (constant set to "AS").
    continentEuropeEurope (constant set to "EU").
    continentOceaniaOceania (constant set to "OC").
If this parameter is not specified, the result contains the list of all countries.
Related Examples:
Country and Continent functions Unit examples (WINDEV): Country and Continent functions
[ + ] This example shows how to use Country / Continent variables and functions.
Business / UI classification: Business Logic
Component: wd270std.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment