Important: The information in this document is obsolete and should not be used for new development.
CompareText
TheCompareText
function compares two text strings, making use of the string comparison information from a resource that you specify as a parameter. It takes both primary and secondary sorting orders into consideration and returns a value that indicates the sorting order of the first string relative to the second string.
FUNCTION CompareText (aPtr, bPtr: Ptr; aLen, bLen: Integer; itl2Handle: Handle): Integer;
aPtr
- A pointer to the first character of the first text string.
bPtr
- A pointer to the first character of the second text string.
aLen
- The number of bytes in the first text string.
bLen
- The number of bytes in the second text string.
itl2Handle
- A handle to a string-manipulation (
'itl2'
) resource that contains string comparison information.DESCRIPTION
CompareText
returns -1 if the first string is less than the second string, 0 if the
first string is equal to the second string, and 1 if the first string is greater than the
second string.The
itl2Handle
parameter is used to specify a string-manipulation resource. If the value of this parameter isNIL
,CompareText
makes use of the resource for the current script. The string-manipulation resource includes routines and 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," beginning on page 5-4.
SPECIAL CONSIDERATIONS
CompareText
may move memory; your application should not call this function at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theCompareText
function are
Trap macro Selector _Pack6 $001A