Carbon


IsMetric

Header: OSUtils.h Carbon status: Supported

Verifies whether the current script system is using the metric system or the English system of measurement.

Boolean IsMetric ();
function result

TRUE if the metric system is being used; FALSE if the English system is being used.

DISCUSSION

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. 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.

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. You can do this by using your own version of the numeric-format resource instead of the current script system’s default international resource.

The IsMetric function is the same as the IUMetric function, which was previously available with the International Utilities Package.

SPECIAL CONSIDERATIONS

The IsMetric function may move or purge blocks in the heap; calling it may cause problems if you’ve dereferenced a handle. Do not call this function from within interrupt code, such as in a completion function or a VBL task.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when InterfaceLib 7.1 or later is installed. Exported by CarbonLib 1.0 and later and by InterfaceLib 7.1 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/6/2000)