LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help in 1D search array

Solved!
Go to solution

Hi,

 

Why i always get -1 for the search 1D array here?? Attach my vi

The purpose is to get rid of the repeat numeric & store if not repeatable.

 

Thanks and Regards,

Simon

LV8.2

0 Kudos
Message 1 of 5
(2,898 Views)

Hi,

 

In your example you try to look for 13 in array [ 3;9;5;8;1;23]. 13 is not inside => function return -1

 

Regards,

 

Yoann

0 Kudos
Message 2 of 5
(2,880 Views)
Solution
Accepted by topic author simon76

I'm not quite sure what you want to achieve, but your search array does return the index of the searched for number. However you search once for every time in the array, and the last time you'll start searching from the last element, thus always -1.

Is the idea to add the numeric to the array if it's not already present? Then it's overly complex (and not functioning).

 

Would these changes solve it?

 

/Y

Message Edited by Yamaeda on 01-27-2010 08:49 AM
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 3 of 5
(2,879 Views)

Hi Yamaeda,

It solve my problem.

Thanks for your help.

 

regards,

0 Kudos
Message 4 of 5
(2,861 Views)
you can also have a look at this
Regards
0 Kudos
Message 5 of 5
(2,851 Views)