09-26-2014 02:15 AM
Hello All,
Please help me if anyone have nice idea.
I want to replace Array elements based on certain conditions.
As per attached Sample,
I have fixed character Array & Some Random values with Array Size.
Here, I need to check Random char with fixed Array. If char is not matching then I need to replace that index value with “NaN”. Once it is matching for one time then next time I need to display Run time value for that particular index.
Solved! Go to Solution.
09-26-2014 05:16 AM
Maybe i misunderstood, but it can give you some ideas.
/Y
09-26-2014 05:16 AM
Maybe i misunderstood, but it can give you some ideas.
/Y
09-26-2014 09:29 AM
Dear Yamaeda,
Thanks for your reply.
your attached VI is not mathching with my requirement. If 1st time Index is matching then next time we should not display NaN (eventhough its not mathching for next time). I have to display NaN until that index is not matching.
after Matching I need to display Runtime Value....
09-26-2014 09:43 AM
Ok, so your program is working as it should? Then what's the question? 🙂
What problem are you trying to solve?
/Y
09-26-2014 10:01 AM
Sorry. I'm thinking to minimize my code.
Just waiting for better solution.
09-26-2014 10:36 AM - edited 09-26-2014 10:43 AM
Yes, you have way too much code for such a simple problem. Also, your random character generator is flawed, because A and Z will only occur at half the probability of the other characters.
Here's a quick draft how it could be done with less code (LV 2012). Modify as needed. I am sure more simplifications are possible....
09-26-2014 11:25 AM - edited 09-26-2014 11:48 AM
Dear Altenbach,
Thanks for your nice idea.
I have made minor changes to your code. Because sometimes i need to check Same character 2-3 times from Fixed array.
I think, once all index values are matching then no need to check.
09-26-2014 12:38 PM
You can just do a "AND array elements" on the boolean array for the outer case structure. No need to convert, sum, compare sizes, etc.
09-26-2014 12:42 PM
Yes.. Thank you altenbach 🙂