07-01-2009 01:58 AM
How can I exit a while loop ?
I'm new to Labview and I've tried to do my first Labview programm.
I've taken an old example, a sieve for prime numbers. The old Erasthotenes sieve.
Similar to that (Visual Basic Example):
While (l <= k) and Teiler <= Math.Sqrt(i)
Teiler = TeilerArray(l)
Solved! Go to Solution.
07-01-2009 02:08 AM
How can I exit a while loop ?
I'm new to Labview and I've tried to do my first Labview programm.
I've taken an old example, a sieve for prime numbers. The old Erasthotenes sieve.
Similar to that (Visual Basic Example):
While (l <= k) And Teiler <= Math.Sqrt(i)
Teiler = TeilerArray(l)
If i Mod Teiler = 0 Then
IstPrim = False
Exit While
End If
l = l + 1
End While
So, how can I model that "Exit While" ?
07-01-2009 02:16 AM
07-01-2009 04:10 AM
Where do I find this "conditional terminal" and what is it called in German ?
Is it "Haltepunkt" in the context menu of the while loop ?
How do I use the "conditional teminal" ?
I use the german version.
07-01-2009 04:18 AM
Pl see the attached snapshot.
Sorry, I dont know German.
07-01-2009 04:35 AM
This is not an exit statement.
See below.
http://zone.ni.com/devzone/cda/tut/p/id/6285
As it seems to be only the for loop supports an exit statement.
"Conditional terminal" in the context menu.
07-01-2009 04:50 AM
Hi Hans,
it is an exit statement. If you connect the correct value to it, then the loop stops.
You can use a case structure to don't run other code if a special "stop event" occur.
Mike
07-01-2009 04:58 AM
Hans,
What you have linked is for the FOR loop, what I had attached is for the WHILE loop. ![]()
Only the type of the loop is different, but the concept or logic is the same for both. ![]()
07-01-2009 05:47 AM
Ok, I will try this.
I've thought that this is only a button to stop the loop.
07-01-2009 07:12 AM
HansWerner wrote:Ok, I will try this.
I've thought that this is only a button to stop the loop.
Yes you are correct, what is the differene between 'exit' and 'stop'
Ton