Xbasic

COUNTRYLOOKUP Function

Syntax

C CountryLookup(C code_or_name )

Country_Number as C = COUNTRYLOOKUP( Country_Name as C )

Country_Name as C = COUNTRYLOOKUP( Country_Number as C )

Arguments

Country_Number

The number of the country as defined by the COUNTRIESOFWORLD()function.

Country_Name

The name of the country as defined by the COUNTRIESOFWORLD()function.

code_or_name

Character

Description

Given a country name, return the country code, or given a country code, return the country name

Discussion

The COUNTRYLOOKUP() function returns either the name or number of a country (as defined by the COUNTRIESOFWORLD() function), given the number or name.

Example

? countryLookup("angola")
= "006"
? countryLookup("002")
= "Afghanistan"

See Also