Important: The information in this document is obsolete and should not be used for new development.
EqualString
TheEqualString
function compares two Pascal strings for equality, using the comparison rules of the Macintosh file system. The comparison performed byEqualString
is a simple, character-by-character value comparison. This function does not make use of any script or language information; it assumes the use of a Roman script system.
FUNCTION EqualString (aStr, bStr: Str255; caseSens, diacSens: Boolean): Boolean;
aStr
- One of the Pascal strings to be compared.
bStr
- The other Pascal string to be compared.
caseSens
- A flag that indicates how to handle case-sensitive information during the comparison. If the value of
caseSens
isTRUE
, uppercase characters are distinguished from the corresponding lowercase characters. If it isFALSE
, case information is ignored.diacSens
- A flag that indicates how to handle information about diacritical marks during the string comparison. If the value of
diacSens
isTRUE
, characters with diacritical marks are distinguished from the corresponding characters without diacritical marks during the comparison. If it isFALSE
, diacritical marks are ignored.DESCRIPTION
EqualString
returnsTRUE
if the two strings are equal andFALSE
if they are not equal. If its value isTRUE
,EqualString
distinguishes uppercase characters from the corresponding lowercase characters. If its value isFALSE
, EqualString ignores diacritical marks during the comparison.SPECIAL CONSIDERATIONS
TheEqualString
function is not localizable.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theEqualString
function are
Trap macro Selector _CmpString $A03C This trap macro can take optional arguments, each of which changes the default setting used by the macro when it is called without arguments. Each of these arguments corresponds to the Boolean parameters that are used with the Pascal function call. The various permutations of this trap macro are shown below; you must type each exactly as it is shown. The syntax shown here applies to the MPW Assembler; if you are using another development system, be sure to consult its documentation for the proper syntax.
Macro permutation Value of diacSens
Value of caseSens
_CmpString FALSE FALSE _CmpString ,MARKS TRUE FALSE _CmpString ,CASE FALSE TRUE _CmpString ,MARKS,CASE TRUE TRUE The registers on entry and exit for this routine are
Registers on entry A0 pointer to first character of the first string A1 pointer to first character of the second string D0 high-order word: number of bytes in the first string low-order word: number of bytes in the second string
Registers on exit D0 long word result: 0 if strings are equal, 1 if strings are not equal