LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I stop a "for" loop?

A silly question, but I can't manage it - I have a "for" loop, and I want to
be able to stop it, with boolean control if possible. I can't find a way to
do it. Is there something like "break" in many other languages?

Thank you, Victor
0 Kudos
Message 1 of 4
(3,090 Views)
you can use application controls stop in functions palette to complete the task.
0 Kudos
Message 2 of 4
(3,090 Views)
Can you use a while loop instead? A while loop will do everything a for
loop can do except stop itself. You have to supply a boolean wired to the
iteration stop.

"Victor Chernov" wrote in message
news:9s3as6$qh$1@news.huji.ac.il...
> A silly question, but I can't manage it - I have a "for" loop, and I want
to
> be able to stop it, with boolean control if possible. I can't find a way
to
> do it. Is there something like "break" in many other languages?
>
> Thank you, Victor
>
>
0 Kudos
Message 3 of 4
(3,090 Views)
"Victor Chernov" wrote in message
news:9s3as6$qh$1@news.huji.ac.il...
> A silly question, but I can't manage it - I have a "for" loop, and I want
to
> be able to stop it, with boolean control if possible. I can't find a way
to
> do it. Is there something like "break" in many other languages?

Use a while loop. If stop button true or counter = (some value -1) then
stop.
0 Kudos
Message 4 of 4
(3,090 Views)