annuler
Affichage des résultats de 
Rechercher plutôt 
Vouliez-vous dire : 

Search 1D Array with first occurance

Résolu !
Accéder à la solution

Maybe I am not being clear. What I am after for is a wildcard search on the 1D array. After the characters are entered, like Eri, I want a wildcard search for any other characters after the initial characters are entered into the Search string control.

 


OK, so don't try my algorithm!  Yes, it's a bit more work, but you can also modify Crossrulz's Sequential Search by using some clever thinking and reading what you, yourself, wrote (quoted above -- "I want a wildcard search ...", so do a wildcard search!).  You'll need to think about how to better handle the "not found" condition, and also think what happens when you are looking for Zelda on a really long list of contacts (you'll have to search the entire list on every character you enter ...).

 

BS 

0 Compliments
Message 11 sur 16
1 876 Visites
Solution
Accepté par l'auteur du sujet Eric1977

I think I figured it out after just stepping back for a moment.

 

I had to use Subset Array along with the string length to compare against each element in the 1D array. Once I found a match using the Greater than Zero primitive, I just used the iteration terminal to feed the MultiColumn Listbox value.

 

Attached is a snippet in case anyone else needs to use this for a project.

 

 

1DArrayFirstOccurance.png

0 Compliments
Message 12 sur 16
1 871 Visites

One more question that relates to this. Since I can now select the row programmactically, how do I make the highlighted item visible without having to manually scroll up/down?

0 Compliments
Message 13 sur 16
1 851 Visites

I'm not sure what you mean by "make the highlighted item visible".  I've not worked with MCListboxes, myself, but I assume that you can set the Active Cell (the one you find programmatically) with the ActiveCell property.  Do you need something other than that?

 

BS

0 Compliments
Message 14 sur 16
1 840 Visites

What I meant was, when I find a match, the row becomes highlighted. The multicolumn listbox only has about 15 names visible to the user. If it goes beyond the visible selections, I want to force the multicolumn listbox to automaticlly scroll to the selection without the user doing this manually.

0 Compliments
Message 15 sur 16
1 827 Visites
Solution
Accepté par l'auteur du sujet Eric1977

There is a property called Top Left Visible Cell.  If you set that to the selected row, then your selected item will be at the top.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Compliments
Message 16 sur 16
1 821 Visites