04-03-2009 12:07 AM
I know how to sort the array of strings alpha numerically but my problem is that the numerical values will not follow there corresponding strings
here is the code i am using:
Solved! Go to Solution.
04-03-2009 12:09 AM
04-03-2009 12:30 AM - edited 04-03-2009 12:31 AM
Well, assuming that the two arrays are of equal size, you would bundle in a FOR loop, sort, the unbundle in a second FOR loop, e.g. as follows:
This takes advantage of the fact that arrays of clusters are sorted according to cluster order.
04-03-2009 01:36 AM
It worked perfectly, I did try this except I tried it with a case statement not a good idea lol
thanks
01-20-2010 12:36 PM
Hi.
It's nice to have "sorting array" icon.
But I have problem with programming similar option. I want to sort my sine samples taken in more periods to just one period.
Beside defining that mycurrent sample should be less than next one, and greater from previous one in one case, I should take in consider that derivation could be positive or negative. While negative derivation, next sample should be less then current and so one.
Can someone help me with programming?
I've extracted the first period, and then I have to go trough each sample and compare him. When logic is well,I get the index and putinsert elemt in array.
I think that I'm having problem with while loops. I don't know where to put them.
I'm attaching VI. beacuse I'm working on Labview 9.0, I'm attaching also a pic.
Thanks in advance.
01-20-2010 01:10 PM - edited 01-20-2010 01:14 PM
Tina
I don't quite see what your problem has to do with sorting, so please start a new thread instead of adding to an old thread that is already marked as solved.
(You seem to have some basic misunderstanding of local variables. A local variable just points to a control or indicator, so writing to an indicator and to a local variable of the same indicator makes no sense. You also introduce a race condition, because there is no quarantee that the reading of the index local occurs after writing to the terminal. If it occurs first (very likely!), your results will be wrong. Eliminate the locals and just branch the blue wire!)