From Clomosy Docs

Compares two strings, with case sensitivity.

CompareStr compares S1 to S2, with case sensitivity. The return value is less than 0 if S1 is less than S2, 0 if S1 equals S2, or greater than 0 if S1 is greater than S2. The comparison operation is based on the 16-bit ordinal value of each character and is not affected by the current locale, when using the first CompareStr overloaded method.



The return value is one of the following.

Example

var
 initialValue,secondValue : String;
 resultValue :Integer;

{
 initialValue = 'Clomosy';
 secondValue  = 'Clomosy';
 
 resultValue = CompareStr(initialValue, secondValue);
 
 if (resultValue < 0) ShowMessage(initialValue+' < '+secondValue);
 if (resultValue == 0) ShowMessage(initialValue+' = '+secondValue);
 if (resultValue > 0) ShowMessage(initialValue+' > '+secondValue);

}

Output:

See Also