Promotic

StringCmp - method of the Pm object

Description:
Returns a result of a comparison of the two strings.
Syntax:
Long StringCmp(String sString1, String sString2, [String sParams])
Parameters:
sString1(String) First string to be compared.
sString2(String) Second string to be compared.
sParams[optional] (String) Additional parameters comparation. Entries are in the KeyVal format, for example mode:begin;ic:0;
mode:s;
mode:full; (default) - The two strings are compared for equality. If the strings length 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) - case sensitive text
ic:1; - case insensitive text
Return values:
0 - sString1 is not equal to sString2
1 - sString1 is equal to sString2
Note:
This method is functional also in Macro expression $.expr and in the onDraw event of the PmgCanvas object.
This method is also functional in Web panels.
Example:
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

History:
Pm8.02.06: Created
PROMOTIC 9.0.17 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
Navigation:
 
- 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