beautypg.com

Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 703

background image

C H A P T E R 1 9

Built-in Applications and System Data

Time Zones

19-29

though that the list of cities and countries is not necessarily the same on your
Newton device and the user of your application. Your application should also check
string names for cities and countries entered by the user.

The

GetCountryEntry

function performs an additional search based on the

class of the string passed in. This is done in order to take into account the language
of the ROM used; the symbols are all in English. To set the class of a string, use the

SetCountryClass

function, described in Chapter 20, “Localizing Newton

Applications.”

The frame returned by the

GetCityEntry

function is the same as the

newCityFrame parameter to the

NewCity

function described in “Adding a City to

a Newton Device” beginning on page 19-29. For information on the frame returned
by the

GetCountryEntry

function see the description of this function in Newton

Programmer’s Reference.

Adding a City to a Newton Device

19

The Time Zones

NewCity

method adds a city to a Newton device. It takes a

newCityFrame parameter which is a frame with the following slots:

Slot descriptions

name

Required. A string containing the name of the location.

longitude

Required. The longitude of the location. The formula for
generating this value appears in “Using Longitude and
Latitude Values” beginning on page 19-30.

latitude

Required. The latitude of the location.

gmt

Required. The offset in minutes from Greenwich Mean Time.

country

Required. A symbol representing the country in which the
city is located.

areaCode

Optional. A string for the area code of the location.

region

Optional. A string for the region of the location. For cities
in the U.S. this should be the state; for cities in Canada
the province.

airport

Optional. A string for the airport designation for the city, or
an array of strings if the city is served by multiple airports.

Here is an example of such a frame:

{name:"Portland",

longitude:354036540,

latitude:67929083,

gmt:

-28800,

country:'USA,