Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Operating System Utilities /
Chapter 4 - Date, Time, and Measurement Utilities / Date, Time, and Measurement Utilities Reference
Routines / Determining the Measurement System


IsMetric

You can use the IsMetric 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). The IsMetric function is also available as the IUMetric function.

FUNCTION IsMetric: BOOLEAN;
DESCRIPTION
The IsMetric function examines the metricSys 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 the metricSys 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 of TRUE. A value of 0 in the metricSys field indicates that the English system of measurement (inches, miles, ounces, degrees Fahrenheit, and so on) is used. In that case, the IsMetric function returns a value of FALSE.

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
The IsMetric 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: Text

For information on how to replace a script system's default international resources, see the chapter "Script Manager" in Inside Macintosh: Text.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996