beautypg.com

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

Page 704

background image

C H A P T E R 1 9

Built-in Applications and System Data

19-30

Notes

areaCode: "503",

region:"OR",

airport:"PDX"}

Using Longitude and Latitude Values

19

To calculate the latitude or longitude of a location, create and use the
following function:

CalcLngLat := func(dgrs, min, secs, westOrSouth) begin

local loc;

loc := dgrs / 180 + min / (180 * 60) + secs

/ (180 * 60 * 60);

loc := rinttol(loc * 0x10000000);

if westOrSouth then

loc := 0x20000000 - loc;

loc;

end;

The built-in utility functions

LatitudeToString

and

LongitudeToString

return a string representation of an encoded integer latitude or longitude value. For
information on these functions see Newton Programmer’s Reference.

Setting the Home City

19

The

SetLocation

method sets the home city. It takes a single parameter

whichCity which is the same as the newCityFrame parameter of the

NewCity

method; see “Adding a City to a Newton Device” beginning on page 19-29. The
following code makes Los Angeles the home city:

GetRoot().worldClock:SetLocation( GetCityEntry

("Los Angeles") [0] );

Notes

19

This section describes the Notes API. The Notes application uses three types of
stationery: regular notes, checklists, and outlines. Figure 19-6 shows a note and a
checklist; an outline (not shown) is like the checklist without the checkboxes.