Important: The information in this document is obsolete and should not be used for new development.
IsMetric
You can use theIsMetric
function to determine whether the current script system is using the metric system (also called the International System of Units) or the English system of measurement (also called the British imperial system). TheIsMetric
function is also available as theIUMetric
function.
FUNCTION IsMetric: BOOLEAN;DESCRIPTION
TheIsMetric
function examines themetricSys
field of the numeric-format resource (resource type'itl0'
) to determine if the current script is using the metric system. A value of 255 in themetricSys
field indicates that the metric system (centimeters, kilometers, milligrams, degrees Celsius, and so on) is being used. In this case,the IsMetric
function returns a value ofTRUE
. A value of 0 in themetricSys
field indicates that the English system of measurement (inches, miles, ounces, degrees Fahrenheit, and so on) is used. In that case, theIsMetric
function returns a value ofFALSE
.If you want to use units of measurement different from that of the current script, you need to override the value of the
metricSys
field in the current numeric-format resource (resource type'itl0'
). You can do this by using your own version of the numeric-format resource instead of the current script system's default international resource.SPECIAL CONSIDERATIONS
TheIsMetric
function may move or purge blocks in the heap; calling it may cause problems if you've dereferenced a handle. You should not call this function from within interrupt code, such as in a completion routine or a VBL task.SEE ALSO
For a complete description of the international numeric-format resource (resource type'itl0'
) and how to use it, see the appendix "International Resources" in Inside Macintosh: TextFor information on how to replace a script system's default international resources, see the chapter "Script Manager" in Inside Macintosh: Text.