CountryList (Function) In french: PaysListe 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.
// Initialize the list of countries arrCountryList is array of Countries = CountryList() FOR EACH oCountry OF arrCountryList ListAdd(LIST_CountryList, oCountry<§Name) 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):
| | continentAfrica | Africa (constant set to "AF"). | continentAntarctica | Antarctica (constant set to "AN"). | continentAsia | Asia (constant set to "AS"). | continentEurope | Europe (constant set to "EU"). | continentNorthAmerica | North America (constant set to "NA"). | continentOceania | Oceania (constant set to "OC"). | continentSouthAmerica | South America (constant set to "SA"). |
If this parameter is not specified, the result contains the list of all countries.
Related Examples:
|
Unit examples (WINDEV): Country and Continent functions
[ + ] This example shows how to use Country / Continent variables and functions.
|
Business / UI classification: Business Logic
This page is also available for…
|
|
|
|