Just wondering if inStr is case sensitive with vbTextCompare set. :)
Printable View
Just wondering if inStr is case sensitive with vbTextCompare set. :)
I did some researches and in my opinion it is not (I'm actually quite sure about it).
------------------
Visual Basic Programmer
------------------
PolComSoft
You will hear a lot about it.
Set it to binary compare
maybe this will help...
Dim SearchString, SearchChar, MyPos
SearchString ="XXpXXpXXPXXP" ' String to search in.
SearchChar = "P" ' Search for "P".
' A textual comparison starting at position 4. Returns 6.
MyPos = Instr(4, SearchString, SearchChar, 1)
' A binary comparison starting at position 1. Returns 9.
MyPos = Instr(1, SearchString, SearchChar, 0)
' Comparison is binary by default (last argument is omitted).
MyPos = Instr(SearchString, SearchChar) ' Returns 9.
MyPos = Instr(1, SearchString, "W") ' Returns 0.
------------------
BlackRose
i think u need this too...
Constant Value Description
vbUseCompareOption -1 Performs a comparison using the setting of the Option Compare statement.
vbBinaryCompare 0 Performs a binary comparison.
vbTextCompare 1 Performs a textual comparison.
vbDatabaseCompare 2 Microsoft Access only. Performs a comparison based on information in your database.
------------------
BlackRose