1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
Public Sub Command1_Click()
'InStr
Debug.Print InStr("abab", "ab")
If InStr("abab", "ab") <> 1 Then Stop
Debug.Print InStr("abab", "aB")
If InStr("abab", "aB") <> 0 Then Stop
Debug.Print InStr(1, "abab", "aB", vbTextCompare)
If InStr(1, "abab", "aB", vbTextCompare) <> 1 Then Stop
Debug.Print InStr(2, "abab", "ab")
If InStr(2, "abab", "ab") <> 3 Then Stop
Debug.Print InStr(3, "abab", "ab")
If InStr(3, "abab", "ab") <> 3 Then Stop
Debug.Print InStr(4, "abab", "ab")
If InStr(4, "abab", "ab") <> 0 Then Stop
Debug.Print InStr(4, "aaabcab", "abc")
If InStr(4, "aaabcab", "abc") <> 0 Then Stop
Debug.Print InStr(4, "abab", "")
If InStr(4, "abab", "") <> 4 Then Stop
Debug.Print InStr(5, "abab", "")
If InStr(5, "abab", "") <> 5 Then Stop
Debug.Print InStr(4, "", "")
If InStr(4, "", "") <> 0 Then Stop 'Jabaco -> 1 / VB -> 0
Debug.Print InStr("abab", "c")
If InStr("abab", "c") <> 0 Then Stop
Debug.Print InStr("a" & String$(50000, "b"), "a")
If InStr("a" & String$(50000, "b"), "a") <> 1 Then Stop
' unicode
Debug.Print InStr("a€€c", "€")
If InStr("a€€c", "€") <> 2 Then Stop
'InStrRev
Debug.Print InStrRev("abab", "ab")
If InStrRev("abab", "ab") <> 3 Then Stop
Debug.Print InStrRev("abab", "ab", -1)
If InStrRev("abab", "ab", -1) <> 3 Then Stop 'Jabaco -> 0 / VB -> 3
Debug.Print InStrRev("abab", "aB")
If InStrRev("abab", "aB") <> 0 Then Stop
' If InStrRev("abab", "aB", , vbTextCompare) <> 3 Then Stop 'Jabaco does not accept, in VB the argument is optional!
Debug.Print InStrRev("abab", "aB", 1, vbTextCompare)
If InStrRev("abab", "aB", 1, vbTextCompare) <> 0 Then Stop
Debug.Print InStrRev("abab", "ab", 2)
If InStrRev("abab", "ab", 2) <> 1 Then Stop
Debug.Print InStrRev("ababc", "a", 2)
If InStrRev("ababc", "a", 2) <> 1 Then Stop
Debug.Print InStrRev("ababab", "ab", 3)
If InStrRev("ababab", "ab", 3) <> 1 Then Stop 'Jabaco -> 3 / VB -> 1
Debug.Print InStrRev("abab", "ab", 4)
If InStrRev("abab", "ab", 4) <> 3 Then Stop
Debug.Print InStrRev("aaabcab", "abc", 4)
If InStrRev("aaabcab", "abc", 4) <> 0 Then Stop 'Jabaco -> 3 / VB -> 0
Debug.Print InStrRev("abab", "", 4)
If InStrRev("abab", "", 4) <> 4 Then Stop
Debug.Print InStrRev("abab", "", 5)
If InStrRev("abab", "", 5) <> 0 Then Stop
Debug.Print InStrRev("", "", 4)
If InStrRev("", "", 4) <> 0 Then Stop
Debug.Print InStrRev("abab", "c")
If InStrRev("abab", "c") <> 0 Then Stop
Debug.Print InStrRev("a" & String$(50000, "b"), "a")
If InStrRev("a" & String$(50000, "b"), "a") <> 1 Then Stop
' unicode
Debug.Print InStrRev("a€€c", "€")
If InStrRev("a€€c", "€") <> 3 Then Stop
End Sub
|