It's an easy decision really. Use FOR when you know exactly how many times you are going to loop. Use REPEAT UNTIL or WHILE when you don't know how many times. REPEAT if you have to loop at least once, WHILE if you don't.
I cheat on that though, I like using UNTIL, in case I ever need to add an evaluation.
Comments
Or not use "for loop" when you need "while" or "repeat until" instead... :-)
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Only time i used for so far was doing a true downto false. Neat lil thing.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
But how do you want to make the to-statement true? Or you let it finish or you change the looping-variable in the loop.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I cheat on that though, I like using UNTIL, in case I ever need to add an evaluation.
RIS Plus, LLC