From Clomosy Docs
function CompareText(const S1, S2: string): Integer;
Compares two strings by their ordinal value, without case sensitivity.
CompareText compares S1 and S2 and returns 0 if they are equal. If S1 is greater than S2, CompareText returns an integer greater than 0. If S1 is less than S2, CompareText returns an integer less than 0. CompareText is not case sensitive and is not affected by the current locale, when using the first CompareText overloaded method.
Note: The AnsiCompareText function should be used, which takes into account multi-byte strings and accented characters.
The return value is one of the following.
s1 < s2 : < 0
s1 = s2 : = 0
s1 > s2 : > 0
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 not case sensitive.
Example
var initialValue,secondValue : String; resultValue :Integer; { initialValue = 'ClomoSY'; secondValue = 'Clomosy'; resultValue = CompareText(initialValue, secondValue); if (resultValue < 0) ShowMessage(initialValue+' < '+secondValue); if (resultValue == 0) ShowMessage(initialValue+' = '+secondValue); if (resultValue > 0) ShowMessage(initialValue+' > '+secondValue); }
Output:
ClomoSY = Clomosy