Results 1 to 10 of 10

Thread: difficult - list, split, search?? <solved>

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Sacofjoea's Avatar
    Join Date
    May 2000
    Location
    Never Never Land
    Posts
    472

    difficult - list, split, search?? <solved>

    I have a listbox which contains a lot of documents and file titles which can range to be anything just about.

    I need to be able to search the listbox with my string but not search word for word same case, but to search each letter in the item on the entire list.

    For instance... say im looking for "Machine" and in my list I have

    Fox runs fast
    big brown bear
    great_white dear
    redmachine of time
    etc...

    I need to be able to pick up "machine" from the 4th item down...
    Since I had no idea how to do this, I tried to split each item (by the spaces) then search for the parts using:

    Code:
    Private Sub Command1_Click()
    For i = 0 To List1.ListCount - 1
    List1.List(i) = Split(List1.List(i), " ")
    If Text1.Text = List1.List(i) Then
    List1.Selected(i) = True
    Exit For
    End If
    Next
    End Sub
    but not fully sure on how I can split each one and if possible, it needs to be more of a defined way of doing it, eg the way I showed at the start - but if someone knows how I can search it using my split idea with the spaces, that would be great as well

    Thanks
    sac
    Last edited by Sacofjoea; Jun 15th, 2002 at 03:00 PM.

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