LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

help with search 1d array

Solved!
Go to solution

hey guys,

 

Im pulling data from a database and storing it as a cluster of 1D arrays, and now I want to find an element in one array using the other array. after getting the two individual arrays I try and search one using search 1D array comparing to a value Ive already generated. I was hoping to use the index from search 1D array to grab an element at that index from the other array.

 

Currently the array im trying to search has one element, the element im trying to find, but I keep getting a -1 back.

 

can anyone see what I'm doing wrong here? is there something I dont understand about search 1D array?

 

Thanks guys

Download All
0 Kudos
Message 1 of 4
(3,068 Views)
Solution
Accepted by topic author pathare535

A common issue here is white space (spaces, tabs, new line characters, etc).  Try using Trim Whitespace on both the search string and the items in the array before searching.


GCentral
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
Message 2 of 4
(3,062 Views)

Hello pathare535,

 

Your code is correct, it work for me.

pathare535.PNG 

The problem might come from your data.You should use debug tool to check the data.

 

Regards

Sabri JATLAOUI - Certified LabVIEW Architect - Certified LabVIEW Developer
0 Kudos
Message 3 of 4
(3,060 Views)

did the trim white space on both strings and that fixed the problem.

 

Thanks!

0 Kudos
Message 4 of 4
(3,040 Views)