LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

output for loop iteration

Solved!
Go to solution

Helloo,

 

is it possible to iterate until N-1 in a FOR-Loop?

What i tried does not work...

 

0 Kudos
Message 21 of 28
(2,886 Views)

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.

 

Message Edited by tbob on 04-21-2010 04:30 PM
- tbob

Inventor of the WORM Global
0 Kudos
Message 22 of 28
(2,875 Views)

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!

 

Download All
0 Kudos
Message 23 of 28
(2,858 Views)
sorry... the last row, not element
0 Kudos
Message 24 of 28
(2,855 Views)

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


0 Kudos
Message 25 of 28
(2,845 Views)

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....

0 Kudos
Message 26 of 28
(2,825 Views)

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.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 27 of 28
(2,822 Views)

Ha! Great!

 

I love you! Of course not sexual!

0 Kudos
Message 28 of 28
(2,815 Views)