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) 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 8.3.27 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