Important: The information in this document is obsolete and should not be used for new development.
WriteLocation
You can use theWriteLocationprocedure to change the geographic location or time-zone information stored in extended parameter RAM.
PROCEDURE WriteLocation (loc: MachineLocation);
loc- The geographic location and time-zone information to write to the extended parameter RAM.
DESCRIPTION
TheWriteLocationprocedure takes the geographic location and time-zone information, specified in thelocparameter, 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, aFractvalue 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 theFractdata type. You can use the Operating System Utilities routinesLong2FixandFix2Fractto accomplish this task. Listing 4-8 on page 4-19 shows a procedure that converts San Francisco's latitude and longitude toFractvalues, then writes theFractvalues to extended parameter RAM using theWriteLocationprocedure.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 writinggmtDelta, you should mask off the top byte because it is reserved. In addition, you should preserve the value ofdlsDelta. Listing 4-10 on page 4-21 shows a procedure that writesgmtDelta, with the top byte masked off, while preserving the value ofdlsDelta.SPECIAL CONSIDERATIONS
AlthoughWriteLocationdoes not move or purge memory, you should not call it at interrupt time.SEE ALSO
For more information on the geographic location record, see page 4-29. For more information on theFractdata type and the conversion routinesLong2Fix,Fix2Fract,Fract2Fix, andFix2Long, see the chapter "Mathematical and Logical Utilities" in this book.