Hi All,
I've been adding more do..loops into some code recently and wondered if there is an actual preference to use the WHILE or UNTIL options in a DO LOOP?
If i think about something simple like:
Isn't this just the same thing?:
I guess it depends on what code and extra loop-counting is required to perform a certain task, but sometimes when i look at the do..loop description in the manual, most of it all looks to be doing the same thing.
Additionally, aren't DO WHILE/UNTIL and LOOP WHILE/UNTIL performing the same tasks to the code within the loop?
Maybe there is some mathematical advantage of placing the WHILE/UNTIL options either at the beginning DO command, or at the ending LOOP command, like if you need to use numbers from 0-7 instead of 1-8 or something similar?
Perhaps somebody can explain any advantages of using DO LOOPS one way instead of the other? or at least offer a clearer definition than what the manual does.
I understand the overall do..loop concept, but it seems (to me) there's some duplicated options under different names that puzzles me ;-)
thanks in advance.
I've been adding more do..loops into some code recently and wondered if there is an actual preference to use the WHILE or UNTIL options in a DO LOOP?
If i think about something simple like:
Code:
DO WHILE B0=0
Code:
DO UNTIL B0>0
Additionally, aren't DO WHILE/UNTIL and LOOP WHILE/UNTIL performing the same tasks to the code within the loop?
Maybe there is some mathematical advantage of placing the WHILE/UNTIL options either at the beginning DO command, or at the ending LOOP command, like if you need to use numbers from 0-7 instead of 1-8 or something similar?
Perhaps somebody can explain any advantages of using DO LOOPS one way instead of the other? or at least offer a clearer definition than what the manual does.
I understand the overall do..loop concept, but it seems (to me) there's some duplicated options under different names that puzzles me ;-)
thanks in advance.