User | Kudos |
---|---|
5 | |
3 | |
2 | |
2 | |
2 |
In common, the loops are divided into two categories: entry control loops and exit control loops. The entry control loop checks the condition first, and the code will get executed only if the condition is true. But in the exit control loop, the code will get executed first, and then the condition is checked.
So the "for loop" and "while loop" are entry control loops that will not execute the code if the condition is false, but the "do while loop" will execute the code (run) one time even if the condition is false because it is an exit control loop.
This is also the case in Labview, where the while loop will execute the code (run) one time even if we wire true to the conditional terminal, but in the for loop, if we wire 0 to the count terminal code inside the loop, it never gets executed.
So it is more meaningful to say the labview's "while loop" as "do while loop".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.