Promotic
WikipediaLinkedInYoutubeTwitterFacebook

StringCmp - method of object Pm

Description:
Returns a result of a comparison of the two strings.
Syntax:
StringCmp(sString1 As String, sString2 As String, [sParams As String]) As Long
Calling:
nRes = Pm.StringCmp(sString1, sString2, 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 format PmNamedValues, for example mode:begin;ic:0;
mode:s;
mode:full; (default) - The two strings are compared for equality. If the strings lenght is different, these cannot be equal.
mode:begin; - The beginning portion of the first string is compared with the whole second string. I.e. whether 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
Note:
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.

Example:
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.20 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