Promotic
WikipediaLinkedInYoutubeTwitterFacebook

StrComp - function of language VBScript

Description:
Returns a value indicating the result of a string comparison.

For the purposes of PROMOTIC system, it is more usefull to use the method: Pm.StringCmp.

Syntax:
StrComp(string1 As String, string2 As String, [compare As Integer]) As Integer
Calling:
n = StrComp(string1, string2[, compare])
Parameters:
string1(String) Any valid string expression.
string2(String) Any valid string expression.
compare[optional] (Integer) Numeric value indicating the kind of comparison to use when evaluating strings. If omitted, a binary comparison is performed.
vbBinaryCompare - perform a binary comparison
vbTextCompare - perform a textual comparison
Return Values:
-1 - string1 is less than string2
0 - string1 is equal to string2
1 - string1 is greater than string2
Example:
Dim sStr1, sStr2, nComp
sStr1 = "ABCD": sStr2 = "abcd"
nComp = StrComp(sStr1, sStr2, 1) ' Returns 0
nComp = StrComp(sStr1, sStr2, 0) ' Returns -1
nComp = StrComp(sStr2, sStr1) ' Returns 1
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice