Important: The information in this document is obsolete and should not be used for new development.
IsMetric
You can use theIsMetricfunction 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). TheIsMetricfunction is also available as theIUMetricfunction.
FUNCTION IsMetric: BOOLEAN;DESCRIPTION
TheIsMetricfunction examines themetricSysfield of the numeric-format resource (resource type'itl0') to determine if the current script is using the metric system. A value of 255 in themetricSysfield indicates that the metric system (centimeters, kilometers, milligrams, degrees Celsius, and so on) is being used. In this case,the IsMetricfunction returns a value ofTRUE. A value of 0 in themetricSysfield indicates that the English system of measurement (inches, miles, ounces, degrees Fahrenheit, and so on) is used. In that case, theIsMetricfunction 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
metricSysfield 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
TheIsMetricfunction 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.
 
  
  
 