04-21-2010 05:46 PM
Helloo,
is it possible to iterate until N-1 in a FOR-Loop?
What i tried does not work...
04-21-2010 06:30 PM - edited 04-21-2010 06:30 PM
You replied to a post made in 2009. You should start a new thread. If you want to interate until N-1, just wire the appropriate number in the N terminal. For example, if N=10, wire a 9 into the N terminal. Really, your question doesn't make any sense. What is N to you?
If you want to iterate and stop short of the N mark, you could put a stop condition on your For Loop. Right click on the border and select Conditional Terminal. This will produce a stop sign in the loop. Add code to stop on the condition you want, like N-1. Or you could use a While loop and add code for the stop condition.
Post your code and let us take a look at it. You will get better answers that way.
04-22-2010 04:28 AM
LABVIEW 8.5
Here´s da example: This Prog replaces all "0" in col 5.
N in the FOR-Loop goes through Data till end of file.
My question was, if there is a more simply way (than i did in this example with "delete from array")
to let the Prog go through Data till Element N-1, so the last element of data should be left away...
sun is shining, oh yeah!
04-22-2010 04:43 AM
04-22-2010 07:18 AM
Hi,
I think you need to think again about what you want to do, and how you can do it.
Rework your algorithm.
You got an array from your file, then you delete the first row, you do your algorithm determining if there is 0 or not and changing them, you stop at the end of the array, then you delete the last row.
That has no sense. What do you want to do exactly?
Then, as tbob said, you should post in a new thread. There is no link between the first thread and yours.
Regards,
Olivier L. | Certified LabVIEW Developer
04-22-2010 04:47 PM
I´m not sure, if i should start a new thread now, i´ve already started writing here....*oops*
what do I wanna do?
I want to read from 2 txt-files, but one textfile has got two rows too much, these are the last two rows, i want to delete them without knowing the number of rows.... don´t know how this should be done.....was that more clear?
good night everybody, the sun has gone to bed, now say hello to moon....
04-22-2010 05:00 PM
Use Delete from Array function. It starts with the last element (if you don't wire index input) and deletes however many elements you specify for length. So if you wire a 2 into the length input and don't wire the index input, it will delete the last two lines.
04-22-2010 05:26 PM
Ha! Great!
I love you! Of course not sexual!