Previous section To contents Next section

14.23 Geographical.Countries

DESCRIPTION
subclass Country variable string iso2 ISO 2-character code aka domain name variable string name variable array(string) aka Country name and as-known-as, if any variable int former Flag that is set if this isn't a country anymore (Like USSR.) constant array(Country) countries All known countries.

METHOD
Geographical.Countries.cast

SYNTAX
string cast("string")

DESCRIPTION
It is possible to cast a country to a string, which will be the same as performing country->name;.

METHOD
Geographical.Countries.from_domain

SYNTAX
Country from_domain(string domain)

DESCRIPTION
Look up a country from a domain name. Returns zero if the domain doesn't map to a country. Note that there are some valid domains that doesn't:
INT
International
MIL
US Military
NET
Network
ORG
Non-Profit Organization
ARPA
Old style Arpanet
NATO
Nato field

And that USA has three domains, Great Britain two:

COM
US Commercial
EDU
US Educational
GOV
US Government
GB
Great Britain (UK)
UK
United Kingdom

METHOD
Geographical.Countries.from_domain

SYNTAX
Country from_domain(string name)

DESCRIPTION
Look up a country from its name or aka. The search is case-insensitive but regards whitespace and interpunctation.

METHOD
Geographical.Countries.`[],
Geographical.Countries.`.

SYNTAX
mixed `[](string what)
mixed `->(string what)

DESCRIPTION
Convenience function for getting a country the name-space way; it looks up whatever it is in the name- and domain-space and

> Geographical.Countries.se;
Result: Country(Sweden)
> Geographical.Countries.djibouti;
Result: Country(Djibouti)
> Geographical.Countries.com;
Result: Country(United States)
> Geographical.Countries.wallis_and_futuna_islands->iso2;
Result: "WF"

RETURNS
that country if possible:

Previous section To contents Next section