Results 1 to 3 of 3

Thread: Searching an array

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    Post

    Can someone tell me what is the fastest way to search something in a big array? For...Next statement doesn't work too good after array gets to big.
    Thanks in advance

    ------------------
    Visual Basic Programmer
    ------------------
    PolComSoft
    You will hear a lot about it.


  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    Are the elements of the array sorted?

    ------------------
    Mark Sreeves
    Analyst Programmer

    [email protected]
    A BMW Group Company



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

    Post

    If the array is not sorted, walk thru it, element by element.
    If it is sorted, you can start in the middle, check if you have to go to the 1st or the 2nd part of the array, then check the half of the part of the array that is left.
    Or cheat, and use an invisible listbox, and use the API to find an item :-)

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