info.mailtraq.com > Management > Script Functions A-Z > StrCmp() StrCmp()Compares two strings and returns an integer value indicating which is the greater (alphabetically). If the first string is less than the second, the result is negative. If the second string is greater, the result is positive (greater than zero). The result is only zero if the two strings are the same. This function should be used in preference to the comparison operators when it is possible that Mailtraq may interpret the parameters as numeric (and thus apply a numeric comparison). For example, 'ix1.0l' is the same as 'ix1l'. when compared numerically, but different when compared textually.
comparison := StrCmp( str1 , str2 )
- str1
- First string to compare
- str2
- Second string to compare
- comparison
- Integer representation of the difference between str1 and str2. The value is less than zero if the first string is less than the second. The value is greater than zero if the second string is greater. The value is zero when the two strings are the same.
|