Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Please let me know the difference between 'do while' and 'for' loop.
-How 'Do while' loop different from 'FOR' loop?
-In what kind of requirements we use 'do while' loop instead of 'for' loop?
-Do we nest the do while loop in the for loop?
Thanks
Are you expecting logic?
Taken from stackoverflow (these are standard programming tools which cover most languages)
A while loop will always evaluate the condition first.
while (condition) {
//gets executed after condition is checked
}
A do/while loop will always execute the code in the do{} block first and then evaluate the condition.
do {
//gets executed at least once
} while (condition);
A for loop allows you to initiate a counter variable, a check condition, and a way to increment your counter all in one line.
for (int x = 0; x < 100; x++) {
//executed until x >= 100
}
Please remember to mark this as helpful or the correct answer if I have helped you or answered your question.
Hi Suraj,
See this post https://community.qlik.com/blogs/qlikviewdesignblog/2013/09/02/loops-in-the-script
Regards!
@Manuel- The blog doesn't talk about while loop.
@Adam- Thanks for the informatio. Is the SYNTAX of all loop types in other programming language is same in Qlikview?
If yes, could you point me to some video tutorial that cover all loops.
Thanks
Seriously google is your friend here along with the qlikview reference manual
yes