Using Instr in a loop ... help - Page 2


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17

Thread: Using Instr in a loop ... help

  1. #16
    Jim Pragit Guest

    Re: Using Instr in a loop ... help


    Hmm...I didn't even know Option Compare Text applied to the Like operator.
    You learn something new everyday. Anyway, I ran a benchmark and using
    Like "[aeiouAEIOU]" is nearly 3 times faster than using Option Compare Text
    with Like "[aeiou]". That's quite a difference, if anyone can confirm or
    deny my results, I would appreciate it.

    - Jim

    "Colin McGuigan" <colin@chicor.com> wrote:
    >Jim Pragit wrote in message <39a54964$1@news.devx.com>...
    >>
    >>Out of curiousity (and because I'm anal), I ran a benchmark and found this
    >>line of code:
    >>
    >> If Mid$(StringIn, x, 1) Like "[aeiouAEIOU]" Then
    >>
    >>to be about 30-40% faster than this line of code:
    >>
    >> If LCase$(Mid$(StringIn, x, 1)) Like "[aeiou]" Then
    >>
    >>For what it's worth, Jim

    >
    >
    >And what happens if you use Option Compare Text?
    >
    >
    >--
    >Colin McGuigan
    >
    >
    >



  2. #17
    Colin McGuigan Guest

    Re: Using Instr in a loop ... help

    Jim Pragit wrote in message <39a562ee$1@news.devx.com>...
    >
    >Hmm...I didn't even know Option Compare Text applied to the Like operator.
    > You learn something new everyday. Anyway, I ran a benchmark and using
    >Like "[aeiouAEIOU]" is nearly 3 times faster than using Option Compare Text
    >with Like "[aeiou]". That's quite a difference, if anyone can confirm or
    >deny my results, I would appreciate it.
    >
    >- Jim


    Neither did I. Lucky guess. =P Then again, I hardly ever use VB's Like
    anyways. =)

    Too bad I've been up for 32 hours and still have work to do, or I'd time
    it...


    --
    Colin McGuigan




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center