StringCmp - method of object Pm

Returns a result of a comparison of the two strings.
StringCmp(sString1 As String, sString2 As String, [sParams As String]) As Long
nRes = Pm.StringCmp(sString1, sString2, sParams)
sString1(String) First string to be compared.
sString2(String) Second string to be compared.
sParams[optional] (String) Additional parameters comparation. Entries are in format KeyVal, for example mode:begin;ic:0;
mode:full; (default) - The two strings are compared for equality. If the strings lenght is different, then these cannot be equal.
mode:begin; - The beginning portion of the first string is compared with the whole second string. It means that the sString1 begins with the sString2.
ic:n; - (IgnoreCase)
ic:0; (default) - The string comparation will work as Case Sensitive.
ic:1; - The string comparation will work as Case Insensitive.
Return Values:
0 - sString1 is not equal to sString2
1 - sString1 is equal to sString2
The method can also be called in the graphic item events for Web panels.

The method is functional also in Macro expression $.expr and in the onDraw event of the PmiCanvas graphic item.

JavaScriptVBScriptSelect and copy to clipboard

var nRes = Pm.StringCmp("Windows 10", "Windows 10");  //nRes contains 1
nRes = Pm.StringCmp("Windows 10", "Windows");  //nRes contains 0
nRes = Pm.StringCmp("Windows 10", "Windows", "mode:begin;");  //nRes contains 1
nRes = Pm.StringCmp("WINDOWS 10", "Windows", "mode:begin;");  //nRes contains 0
nRes = Pm.StringCmp("WINDOWS 10", "Windows", "mode:begin;ic:1;");  //nRes contains 1
PROMOTIC 8.3.30 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
- Pm
- Abs
- Cos
- E
- Exp
- LN2
- PI
- Pow
- Sin
- StringCmp
- Tan
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice