Click to See Complete Forum and Search --> : InStr function ... case sensitive?
MicahCarrick
Jan 17th, 2000, 12:24 AM
Just wondering if inStr is case sensitive with vbTextCompare set. :)
QWERTY
Jan 17th, 2000, 01:22 AM
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.
Crazy D
Jan 17th, 2000, 01:58 AM
Set it to binary compare
BlackRose
Jan 17th, 2000, 06:16 AM
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
BlackRose
Jan 17th, 2000, 06:17 AM
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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.