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: Text /
Chapter 5 - Text Utilities / Text Utilities Reference
Routines / Comparing Strings for Equality


IdenticalString

The IdenticalString function compares two Pascal strings for equality, making use of the string comparison information from a resource that you specify as a parameter. IdenticalString uses only primary differences in its comparison.

FUNCTION IdenticalString (aStr, bStr: Str255;
                          itl2Handle: Handle): Integer;
aStr
One of the Pascal strings to be compared.
bStr
The other Pascal string to be compared.
itl2Handle

A handle to a string-manipulation ('itl2') resource that contains string comparison information.
DESCRIPTION
IdenticalString returns 0 if the two strings are equal and 1 if they are not equal. It compares the two strings without regard for secondary sorting order, the meaning of which depends on the language of the strings. For example, for the English language, using only primary differences means that IdenticalString ignores diacritical marks and does not distinguish between lowercase and uppercase. For example, if the two strings are 'Rose' and 'rosé', IdenticalString considers them equal and returns 0.

The itl2Handle parameter is used to specify a string-manipulation resource. If the value of this parameter is NIL, IdenticalString makes use of the resource for the current script. The string-manipulation resource includes tables for modifying string comparison and tables for case conversion and stripping of diacritical marks.

Specifying a resource as a parameter is described in the section "Obtaining Resource Information," which begins on page 5-4.

SPECIAL CONSIDERATIONS
IdenticalString may move memory; your application should not call this function at interrupt time.

ASSEMBLY-LANGUAGE INFORMATION
There is no trap macro for the IdenticalString function. Instead, you must convert the Pascal string into a text string by creating a pointer to its first character and finding its length, and then use the same macro as you do for the IdenticalText function, which is described next.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996