WriteLocationYou can use the
WriteLocationprocedure to change the geographic location or time-zone information stored in extended parameter RAM.
PROCEDURE WriteLocation (loc: MachineLocation);
- The geographic location and time-zone information to write to the extended parameter RAM.
WriteLocationprocedure takes the geographic location and time-zone information, specified in the
locparameter, and writes it to the extended parameter RAM.
The latitude and longitude are stored in the geographic location record as
Fractvalues, giving accuracy to within 1 foot. For example, a
Fractvalue of 1.0 equals 90 degrees; -1.0 equals -90 degrees; and -2.0 equals -180 degrees.
To store latitude and longitude values, you need to convert them first to the
Fixeddata type, then to the
Fractdata type. You can use the Operating System Utilities routines
Fix2Fractto accomplish this task. Listing 4-8 on page 4-19 shows a procedure that converts San Francisco's latitude and longitude to
Fractvalues, then writes the
Fractvalues to extended parameter RAM using the
The daylight savings time value is a signed byte value that you can use to specify the offset for the
hourfield--whether to add one hour, subtract one hour, or make no change at all.
The Greenwich mean time value is in seconds east of GMT. For example, San Francisco is at -28,800 seconds (8 hours * 3,600 seconds per hour) east of GMT. The
gmtDeltafield is a 3-byte value contained in a long word, so you must take care to set it properly. When writing
gmtDelta, you should mask off the top byte because it is reserved. In addition, you should preserve the value of
dlsDelta. Listing 4-10 on page 4-21 shows a procedure that writes
gmtDelta, with the top byte masked off, while preserving the value of
WriteLocationdoes not move or purge memory, you should not call it at interrupt time.
SEE ALSOFor more information on the geographic location record, see page 4-29. For more information on the
Fractdata type and the conversion routines
Fix2Long, see the chapter "Mathematical and Logical Utilities" in this book.