StrCompare

This function compares two specified string objects, ignoring or adhering to their case, and returns an integer that indicates their relative position in the sort order.

SYNTAX
StrCompare(strA, strB, ignorecase) 
ARGUMENTS

strA The first string to compare
strB The second string to compare
ignoreCase TRUE = Case is ignored during the search

FALSE = Case is included in the search

RETURN A 32-bit signed integer that indicates the lexical relationship between the two strings compared.

< 0 = strA is less than strB

= 0 = strA is equal to strB

> 0 = strA is greater than strB

EXAMPLE
;Compare

retvalue = StrCompare("String to compare.","String to compare.",true)

if(retvalue <> 0)

  Raise("Error", "StrCompare() The result should be 0.")

end-if

 

;Case sensitive test

retvalue = StrCompare("Cat","cat",false)

if(retvalue = 0)

  Raise("Error", "StrCompare() The result should not be 0.")

end-if