From Clomosy Docs

Compares strings based on the current locale with case sensitivity.

AnsiCompareStr compares S1 to S2, with case sensitivity. The comparison operation is controlled by the current locale. The return value is one of the following.

The comparison is not affected by length - it is carried out on a letter by letter basis. But a longer string is greater than a shorter, otherwise matching string.
The comparison is case sensitive.

Example

 var
   initialValue,secondValue : String;
   resultValue :Integer;
 
 {
 
   initialValue = 'Clomosy';
   secondValue  = 'Clomosy';
   
   resultValue = AnsiCompareStr(initialValue, secondValue);
   
   if (resultValue < 0) ShowMessage(initialValue+' < '+secondValue);
   if (resultValue == 0) ShowMessage(initialValue+' = '+secondValue);
   if (resultValue > 0) ShowMessage(initialValue+' > '+secondValue);
 
 }

Output:

See Also