background image
C H A P T E R 1 9
Built-in Applications and System Data
Time Zones
Using the Time Zone Application
The application program interface provides functions for retrieving information
about cities and countries, a method to add a city to a Newton device's list of cities,
and a method to set the home city. To call a Time Zones method, you need a
reference to the application. To obtain this reference, use the following code:
Note that future Newton devices may not include the Time Zones application. You
should therefore check for the existence of the Time Zones application before
trying to access it. Use the following code to test for this:
if GetRoot().worldClock then ...
Obtaining Information About a City or Country
global functions return information
about a number of cities and countries around the world. This information is
available to the user by picking All Info from the Show picker, shown in Figure 19-5.
Figure 19-5
Time Zones application's All Info view
Both these functions take a string as an argument for the city or country to return
information about. The search is conducted by string comparison with this
argument. You should be aware that although there may be variations of the name
of a city or country, only one name is stored on the Newton device. For example,
GetCityEntry("Los Angeles")
returns a frame with information about Los
Angeles, but
does not. You should check the spelling in
the Time Zones application of city or country names you wish to use. Keep in mind
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна