LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

searching through a table

hello,

what i have is a table with binary strings.  i am seaching through the table to find matching strings that the user inputs.  i use a for loop but i need a way to do a few options.

1. i know there is a way to use the for loop without having to specify a "N" value but is the way i am doing it sufficient.
2.  my program is not highlighting all the occurences, it is skipping some occurences
3.  search for 1st occurence
4  Go to next occurence
5.  Find all occurences
6.  an option to clear the table and the table selections.

i attached a vi that does the searching but that's about it.  thank you in advance
0 Kudos
Message 1 of 5
(3,297 Views)
SInce you don't know how many elements will match, you must use a while loop, not a FOR loop.
 
Simply reshape the array to a 1D, the use search 1D array until you run out of elements. Attached is a quick sketch (LAbVIEW 8.0), see if you can take it from there. It also shows a way to reset all table backgrounds to white. 😄
(There are many other ways to do this.)
Message 2 of 5
(3,286 Views)
thank you for the help
0 Kudos
Message 3 of 5
(3,261 Views)
If the number of matching elements are known, how would this VI be arranged with a For Loop?
0 Kudos
Message 4 of 5
(3,186 Views)


@jac187 wrote:
If the number of matching elements are known, how would this VI be arranged with a For Loop?

  1. replace the while loop with a FOR loop
  2. wire the known item number to N
  3. remove the case structure, leaving only the code in the default case.
  4. everything else stays the same.
0 Kudos
Message 5 of 5
(3,178 Views)