InstrRev - function of language VBScript

Returns the position of an occurrence of one string within another, from the end of string.
InstrRev(string1 As String, string2 As String, [start As Integer], [compare As Integer]) As Integer
n = InstrRev(string1, string2[, start[, compare]])
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 Values:
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
The syntax for this function is not the same as the syntax for the InStr function.
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 8.3.26 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