01-27-2010 12:45 AM
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
Solved! Go to Solution.
01-27-2010 01:46 AM
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
01-27-2010 01:48 AM - edited 01-27-2010 01:49 AM
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
01-27-2010 02:33 AM
Hi Yamaeda,
It solve my problem.
Thanks for your help.
regards,
01-27-2010 03:41 AM