Listbox search for partial matches - Forum

Forum Navigation
You need to log in to create posts and topics.

Listbox search for partial matches

I knew I was a bit rusty but .. wow.

Can one search for partial matches in a listbox?

ListBoxFindItem "ComboBox2" "[LookFor]" "[Found]"

I would like the LookFor to work as a partial string, so that anything that matches a part of the entry will still find it.  I tried * as a wildcard attempt, but .... no workie ;-)

Thanks all.

Hello,

You may have a look at hpwControl:

Taken from the demo:

Assuming you have a multiline-variable with all Listbox entrys.

Search the string and get the offset. With the offset find the linenumber. The linenumber is the listbox number.

hpwStrSearch "[SearchString1]" "[SearchInStr1]" "[Offset1]" "[CaseSens1]" "[SearchResult]"
hpwLineNumber "[FruitLst1]" "[NumberStr]" "True" "[LNumb]"

Regards

Hans-Peter

 

rcohen has reacted to this post.
rcohen

Thank you Hans!   I'll have a look at it.   But if we will search first using another method, I guess I can try to figure out how to do this without a plugin...  that's a great thought.

Cheers

rcohen

@rcohen

There could be a number of ways to do this without a plugin.
First off try this:

ListBoxGetItem "ListBox1" "All" "[ListBoxAll]"

Your variable [ListBoxAll] will be a single string with each ListBox item seperated by a pipe, |
You can either SearchStr or StrParse and Loop through each parsed variable, etc.

rcohen has reacted to this post.
rcohen

HI Paul,

Yes, thank you.   I was on that track for a bit but didn't catch the array format you speak of.    Thanks for the direction.... I'll give that a try.    @HPW I looked at the control plugin and am trying to figure it out, but I seem to be missing something.   I must translate your help file to English and give that a shot ;-0

Thanks all