Results 1 to 5 of 5

Thread: InStr function ... case sensitive?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Location
    Californ-I- A
    Posts
    207

    Post

    Just wondering if inStr is case sensitive with vbTextCompare set.

  2. #2
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    Post

    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.


  3. #3
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386

    Post

    Set it to binary compare

  4. #4
    Member
    Join Date
    Sep 1999
    Location
    Lebanon, Beirut
    Posts
    63

    Post

    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


  5. #5
    Member
    Join Date
    Sep 1999
    Location
    Lebanon, Beirut
    Posts
    63

    Post

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width