Promotic
WikipediaLinkedInYoutubeTwitterFacebook

StrComp - function of language VBScript

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

In the PROMOTIC system it is better to use the Pm.StringCmp method.

Syntax:
Integer StrComp(String string1, String string2, [Integer compare])
Parameters:
string1(String) Text string
string2(String) Text string
compare[optional] (Integer) Numeric value indicating the kind of comparison to use when evaluating strings. If not set, then 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:
VBScriptSelect and copy to clipboard

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
PROMOTIC 9.0.13 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice