Promotic

InstrRev - function of language VBScript

Description:
Returns the position of an occurrence of one string within another, from the end of the string.
Syntax:
Integer InstrRev(String string1, String string2, [Integer start], [Integer compare])
Parameters:
string1(String) Text string being searched
string2(String) Text string searched for
start[optional] (Integer) Numeric expression that sets the starting position for each search.
If not set, then -1 is used (it means that the search begins at the last character position).
compare[optional] (Integer) Numeric value indicating the kind of comparison to use when evaluating substrings.
If not set, then a binary comparison is performed.
vbBinaryCompare - perform a binary comparison
vbTextCompare - perform a textual comparison
Return value:
0 - string1 is zero-length or string2 is not found or start > Len(string2)
Null - string1 or string2=Null
start - string2 is zero-length
position at which match is found - string2 is found within string1
Note:
The syntax for this function is not the same as the syntax for the InStr function.
Example:
VBScriptSelect and copy to clipboard

Dim SearchString, SearchChar, nPos
SearchString = "XXpXXpXXPXXP"
SearchChar = "P"
nPos = InstrRev(SearchString, SearchChar, 10, 0)   ' a binary comparison starting at position 10, returns 9
nPos = InstrRev(SearchString, SearchChar, -1, 1)   ' a textual comparison starting at the last position, returns 12
nPos = InstrRev(SearchString, SearchChar, 8)   ' a binary comparison, returns 0
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.